fix(eslint): add missing useCallback deps, remove stale disable directives
- useMessageSearch: add fromTs/toTs to useCallback dep array (exhaustive-deps error) - useMessageSearch: restore eslint-disable on the correct line for the `as any` cast - VoiceMessageRecorder: remove two eslint-disable directives for rules that are globally off (jsx-a11y/media-has-caption) or not enabled (react/no-array-index-key) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -228,7 +228,6 @@ export function VoiceMessageRecorder({ onSend, onError }: VoiceRecorderProps) {
|
|||||||
>
|
>
|
||||||
{waveformBars.map((h, i) => (
|
{waveformBars.map((h, i) => (
|
||||||
<div
|
<div
|
||||||
// eslint-disable-next-line react/no-array-index-key
|
|
||||||
key={i}
|
key={i}
|
||||||
style={{
|
style={{
|
||||||
width: toRem(2),
|
width: toRem(2),
|
||||||
@@ -276,7 +275,6 @@ export function VoiceMessageRecorder({ onSend, onError }: VoiceRecorderProps) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{previewUrl && (
|
{previewUrl && (
|
||||||
// eslint-disable-next-line jsx-a11y/media-has-caption
|
|
||||||
<audio src={previewUrl} controls style={{ height: toRem(28), maxWidth: toRem(180) }} />
|
<audio src={previewUrl} controls style={{ height: toRem(28), maxWidth: toRem(180) }} />
|
||||||
)}
|
)}
|
||||||
<Text size="T200" style={{ fontVariantNumeric: 'tabular-nums', flexShrink: 0 }}>
|
<Text size="T200" style={{ fontVariantNumeric: 'tabular-nums', flexShrink: 0 }}>
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ export const useMessageSearch = (params: MessageSearchParams) => {
|
|||||||
after_limit: 0,
|
after_limit: 0,
|
||||||
include_profile: false,
|
include_profile: false,
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
filter: {
|
filter: {
|
||||||
limit,
|
limit,
|
||||||
rooms,
|
rooms,
|
||||||
@@ -100,6 +99,7 @@ export const useMessageSearch = (params: MessageSearchParams) => {
|
|||||||
// from_ts / to_ts are valid Matrix spec fields not yet in SDK types
|
// from_ts / to_ts are valid Matrix spec fields not yet in SDK types
|
||||||
...(fromTs !== undefined && { from_ts: fromTs }),
|
...(fromTs !== undefined && { from_ts: fromTs }),
|
||||||
...(toTs !== undefined && { to_ts: toTs }),
|
...(toTs !== undefined && { to_ts: toTs }),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
} as any,
|
} as any,
|
||||||
include_state: false,
|
include_state: false,
|
||||||
order_by: order as SearchOrderBy.Recent,
|
order_by: order as SearchOrderBy.Recent,
|
||||||
@@ -114,7 +114,7 @@ export const useMessageSearch = (params: MessageSearchParams) => {
|
|||||||
});
|
});
|
||||||
return parseSearchResult(r);
|
return parseSearchResult(r);
|
||||||
},
|
},
|
||||||
[mx, term, order, rooms, senders],
|
[mx, term, order, rooms, senders, fromTs, toTs],
|
||||||
);
|
);
|
||||||
|
|
||||||
return searchMessages;
|
return searchMessages;
|
||||||
|
|||||||
Reference in New Issue
Block a user