aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-06-29 14:28:16 +0200
committerV <vendicated@riseup.net>2023-06-29 14:28:16 +0200
commite12c0e546c9042bebc31431b3b870d3c036d744d (patch)
treedbba1cbe68f1eef7ea2735298b7c60031370e816
parent088a8bd1b681b6983c19a8b062e7f755374a4335 (diff)
downloadVencord-e12c0e546c9042bebc31431b3b870d3c036d744d.tar.gz
Vencord-e12c0e546c9042bebc31431b3b870d3c036d744d.tar.bz2
Vencord-e12c0e546c9042bebc31431b3b870d3c036d744d.zip
PronounDB: Fix crash
-rw-r--r--src/plugins/pronoundb/pronoundbUtils.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/pronoundb/pronoundbUtils.ts b/src/plugins/pronoundb/pronoundbUtils.ts
index cade882..63565bb 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);