PronounDB: Strip newlines from Discord Pronouns (Discord is stupid)
This commit is contained in:
parent
5edbd2391d
commit
5e71ed286e
1 changed files with 5 additions and 0 deletions
|
@ -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!
|
||||
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)
|
||||
return discordPronouns;
|
||||
|
||||
|
|
Loading…
Reference in a new issue