PronounDB: Strip newlines from Discord Pronouns (Discord is stupid)

This commit is contained in:
V 2023-06-25 19:08:18 +02:00
parent 5edbd2391d
commit 5e71ed286e
No known key found for this signature in database
GPG Key ID: A1DC0CFB5615D905

@ -86,8 +86,13 @@ export function useProfilePronouns(id: string, discordPronouns: string) {
} }
const NewLineRe = /\n+/g;
// Gets the cached pronouns, if you're too impatient for a promise! // Gets the cached pronouns, if you're too impatient for a promise!
export function getCachedPronouns(id: string, discordPronouns: string): string | null { export function getCachedPronouns(id: string, discordPronouns: string): string | null {
// Discord is so stupid you can put tons of newlines in pronouns
discordPronouns = discordPronouns?.trim().replace(NewLineRe, " ");
if (settings.store.pronounSource === PronounSource.PreferDiscord && discordPronouns) if (settings.store.pronounSource === PronounSource.PreferDiscord && discordPronouns)
return discordPronouns; return discordPronouns;