Search: Fix infinite message loading (#2488)
This commit is contained in:
parent
357eef783b
commit
422e13262f
@ -54,7 +54,8 @@ const AudioResults: FC<OwnProps & StateProps> = ({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [currentType, lastSyncTime, searchMessagesGlobal]);
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `searchQuery` is required to prevent infinite message loading
|
||||||
|
}, [currentType, lastSyncTime, searchMessagesGlobal, searchQuery]);
|
||||||
|
|
||||||
const foundMessages = useMemo(() => {
|
const foundMessages = useMemo(() => {
|
||||||
if (!foundIds || !globalMessagesByChatId) {
|
if (!foundIds || !globalMessagesByChatId) {
|
||||||
|
|||||||
@ -64,7 +64,8 @@ const ChatMessageResults: FC<OwnProps & StateProps> = ({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [lastSyncTime, searchMessagesGlobal]);
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `searchQuery` is required to prevent infinite message loading
|
||||||
|
}, [lastSyncTime, searchMessagesGlobal, searchQuery]);
|
||||||
|
|
||||||
const handleTopicClick = useCallback(
|
const handleTopicClick = useCallback(
|
||||||
(id: number) => {
|
(id: number) => {
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import {
|
|||||||
import { MEMO_EMPTY_ARRAY } from '../../../util/memo';
|
import { MEMO_EMPTY_ARRAY } from '../../../util/memo';
|
||||||
import { throttle } from '../../../util/schedulers';
|
import { throttle } from '../../../util/schedulers';
|
||||||
import { renderMessageSummary } from '../../common/helpers/renderMessageText';
|
import { renderMessageSummary } from '../../common/helpers/renderMessageText';
|
||||||
|
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
import useHorizontalScroll from '../../../hooks/useHorizontalScroll';
|
import useHorizontalScroll from '../../../hooks/useHorizontalScroll';
|
||||||
import useAppLayout from '../../../hooks/useAppLayout';
|
import useAppLayout from '../../../hooks/useAppLayout';
|
||||||
@ -85,7 +86,8 @@ const ChatResults: FC<OwnProps & StateProps> = ({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [lastSyncTime, searchMessagesGlobal]);
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `searchQuery` is required to prevent infinite message loading
|
||||||
|
}, [lastSyncTime, searchMessagesGlobal, searchQuery]);
|
||||||
|
|
||||||
const handleChatClick = useCallback(
|
const handleChatClick = useCallback(
|
||||||
(id: string) => {
|
(id: string) => {
|
||||||
|
|||||||
@ -66,7 +66,8 @@ const FileResults: FC<OwnProps & StateProps> = ({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [lastSyncTime, searchMessagesGlobal]);
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `searchQuery` is required to prevent infinite message loading
|
||||||
|
}, [lastSyncTime, searchMessagesGlobal, searchQuery]);
|
||||||
|
|
||||||
const foundMessages = useMemo(() => {
|
const foundMessages = useMemo(() => {
|
||||||
if (!foundIds || !globalMessagesByChatId) {
|
if (!foundIds || !globalMessagesByChatId) {
|
||||||
|
|||||||
@ -64,7 +64,8 @@ const LinkResults: FC<OwnProps & StateProps> = ({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [lastSyncTime, searchMessagesGlobal]);
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `searchQuery` is required to prevent infinite message loading
|
||||||
|
}, [lastSyncTime, searchMessagesGlobal, searchQuery]);
|
||||||
|
|
||||||
const foundMessages = useMemo(() => {
|
const foundMessages = useMemo(() => {
|
||||||
if (!foundIds || !globalMessagesByChatId) {
|
if (!foundIds || !globalMessagesByChatId) {
|
||||||
|
|||||||
@ -62,7 +62,8 @@ const MediaResults: FC<OwnProps & StateProps> = ({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [lastSyncTime, searchMessagesGlobal]);
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `searchQuery` is required to prevent infinite message loading
|
||||||
|
}, [lastSyncTime, searchMessagesGlobal, searchQuery]);
|
||||||
|
|
||||||
const foundMessages = useMemo(() => {
|
const foundMessages = useMemo(() => {
|
||||||
if (!foundIds || !globalMessagesByChatId) {
|
if (!foundIds || !globalMessagesByChatId) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user