Fix chat history search

This commit is contained in:
MyNameIsBatman 2022-09-21 01:40:32 -03:00
parent 2fb75b3e17
commit dd9969baf7

View File

@ -20,7 +20,7 @@ export const ChatHistoryView: FC<{}> = props =>
let text = searchText.toLowerCase();
return chatHistory.filter(entry => (entry.message.toLowerCase().includes(text)) || entry.name.includes(text));
return chatHistory.filter(entry => ((entry.message && entry.message.toLowerCase().includes(text))) || (entry.name && entry.name.toLowerCase().includes(text)));
}, [ chatHistory, searchText ]);
useEffect(() =>