1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00

Merge branch 'dev' into immediate-finds

This commit is contained in:
Nuckyz 2024-09-22 15:20:56 -03:00
commit 4760f137a3
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -19,7 +19,7 @@
import { getCurrentChannel } from "@utils/discord"; import { getCurrentChannel } from "@utils/discord";
import { useAwaiter } from "@utils/react"; import { useAwaiter } from "@utils/react";
import { findStore } from "@webpack"; import { findStore } from "@webpack";
import { UserProfileStore } from "@webpack/common"; import { UserProfileStore, UserStore } from "@webpack/common";
import { settings } from "./settings"; import { settings } from "./settings";
import { PronounMapping, Pronouns, PronounsCache, PronounSets, PronounsFormat, PronounSource, PronounsResponse } from "./types"; import { PronounMapping, Pronouns, PronounsCache, PronounSets, PronounsFormat, PronounSource, PronounsResponse } from "./types";
@ -158,10 +158,15 @@ export function useFormattedPronouns(id: string, useGlobalProfile: boolean = fal
} }
export function useProfilePronouns(id: string, useGlobalProfile: boolean = false): Pronouns { export function useProfilePronouns(id: string, useGlobalProfile: boolean = false): Pronouns {
const pronouns = useFormattedPronouns(id, useGlobalProfile); try {
const pronouns = useFormattedPronouns(id, useGlobalProfile);
if (!settings.store.showInProfile) return EmptyPronouns; if (!settings.store.showInProfile) return EmptyPronouns;
if (!settings.store.showSelf && id === UserProfileStore.getCurrentUser()?.id) return EmptyPronouns; if (!settings.store.showSelf && id === UserStore.getCurrentUser()?.id) return EmptyPronouns;
return pronouns; return pronouns;
} catch (e) {
console.error(e);
return EmptyPronouns;
}
} }