PronounDB: Fix crash
This commit is contained in:
parent
088a8bd1b6
commit
e12c0e546c
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user