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) => (
|
||||
<div
|
||||
// eslint-disable-next-line react/no-array-index-key
|
||||
key={i}
|
||||
style={{
|
||||
width: toRem(2),
|
||||
@@ -276,7 +275,6 @@ export function VoiceMessageRecorder({ onSend, onError }: VoiceRecorderProps) {
|
||||
}}
|
||||
>
|
||||
{previewUrl && (
|
||||
// eslint-disable-next-line jsx-a11y/media-has-caption
|
||||
<audio src={previewUrl} controls style={{ height: toRem(28), maxWidth: toRem(180) }} />
|
||||
)}
|
||||
<Text size="T200" style={{ fontVariantNumeric: 'tabular-nums', flexShrink: 0 }}>
|
||||
|
||||
@@ -92,7 +92,6 @@ export const useMessageSearch = (params: MessageSearchParams) => {
|
||||
after_limit: 0,
|
||||
include_profile: false,
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
filter: {
|
||||
limit,
|
||||
rooms,
|
||||
@@ -100,6 +99,7 @@ export const useMessageSearch = (params: MessageSearchParams) => {
|
||||
// from_ts / to_ts are valid Matrix spec fields not yet in SDK types
|
||||
...(fromTs !== undefined && { from_ts: fromTs }),
|
||||
...(toTs !== undefined && { to_ts: toTs }),
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any,
|
||||
include_state: false,
|
||||
order_by: order as SearchOrderBy.Recent,
|
||||
@@ -114,7 +114,7 @@ export const useMessageSearch = (params: MessageSearchParams) => {
|
||||
});
|
||||
return parseSearchResult(r);
|
||||
},
|
||||
[mx, term, order, rooms, senders],
|
||||
[mx, term, order, rooms, senders, fromTs, toTs],
|
||||
);
|
||||
|
||||
return searchMessages;
|
||||
|
||||
Reference in New Issue
Block a user