From 20183377815e454916aee8434b684a035f687ced Mon Sep 17 00:00:00 2001 From: Elvyra <88881326+EepyElvyra@users.noreply.github.com> Date: Thu, 6 Feb 2025 01:59:45 +0100 Subject: [PATCH] fix silly crash Co-authored-by: sadan4 <117494111+sadan4@users.noreply.github.com> --- src/components/SearchModal.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/components/SearchModal.tsx b/src/components/SearchModal.tsx index ad58e8974..278abaaf1 100644 --- a/src/components/SearchModal.tsx +++ b/src/components/SearchModal.tsx @@ -440,16 +440,19 @@ export default ErrorBoundary.wrap(function SearchModal({ modalProps, onSubmit, i return clean; }; - const guilds: GuildResult[] = useStateFromStores([GuildStore], () => Object.values(GuildStore.getGuilds()).map( - guild => { - return { - type: TextTypes.GUILD, - record: guild, - score: 0, - comparator: guild.name - }; - } - )); + let guilds: GuildResult[] = []; + + if (resultTypes.includes("GUILD")) + guilds = Object.values(GuildStore.getGuilds()).map( + guild => { + return { + type: TextTypes.GUILD, + record: guild, + score: 0, + comparator: guild.name + }; + } + ); const { results, hasQuery, frequentChannels, channelHistory } = props; if (hasQuery) return filterItems(results);