From e12c0e546c9042bebc31431b3b870d3c036d744d Mon Sep 17 00:00:00 2001 From: V Date: Thu, 29 Jun 2023 14:28:16 +0200 Subject: [PATCH] PronounDB: Fix crash --- src/plugins/pronoundb/pronoundbUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/pronoundb/pronoundbUtils.ts b/src/plugins/pronoundb/pronoundbUtils.ts index cade88265..63565bb0d 100644 --- a/src/plugins/pronoundb/pronoundbUtils.ts +++ b/src/plugins/pronoundb/pronoundbUtils.ts @@ -66,14 +66,14 @@ export function useFormattedPronouns(id: string): string | null { // Discord is so stupid you can put tons of newlines in pronouns const discordPronouns = getDiscordPronouns(id)?.trim().replace(NewLineRe, " "); - if (settings.store.pronounSource === PronounSource.PreferDiscord && discordPronouns) - return discordPronouns; - const [result] = useAwaiter(() => fetchPronouns(id), { fallbackValue: getCachedPronouns(id), onError: e => console.error("Fetching pronouns failed: ", e) }); + if (settings.store.pronounSource === PronounSource.PreferDiscord && discordPronouns) + return discordPronouns; + if (result && result !== "unspecified") return formatPronouns(result);