mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 09:56:24 +00:00
fix: dont animate banners if the setting is off
This commit is contained in:
parent
03d2691fff
commit
052c4d928d
1 changed files with 7 additions and 2 deletions
|
@ -44,7 +44,10 @@ const useFetchMemberProfile = (userId: string): string => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (!profile?.banner) return "";
|
if (!profile?.banner) return "";
|
||||||
return `https://cdn.discordapp.com/banners/${userId}/${profile.banner}`;
|
const extension = settings.store.animate && profile.banner.startsWith("a_")
|
||||||
|
? ".gif"
|
||||||
|
: ".png";
|
||||||
|
return `https://cdn.discordapp.com/banners/${userId}/${profile.banner}${extension}`;
|
||||||
};
|
};
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "BannersEverywhere",
|
name: "BannersEverywhere",
|
||||||
|
@ -83,7 +86,9 @@ export default definePlugin({
|
||||||
|
|
||||||
memberListBanner: ErrorBoundary.wrap(({ user }: { user: User; }) => {
|
memberListBanner: ErrorBoundary.wrap(({ user }: { user: User; }) => {
|
||||||
let url: string | null = null;
|
let url: string | null = null;
|
||||||
if (Vencord.Plugins.isPluginEnabled("USRBG")) {
|
// usrbg api has no way of telling if the banner is animated or not
|
||||||
|
// if the user doesnt want animated banners, just get rid of usrbg until there is a way to tell
|
||||||
|
if (settings.store.animate && Vencord.Plugins.isPluginEnabled("USRBG")) {
|
||||||
const USRBG = Vencord.Plugins.plugins.USRBG as unknown as typeof import("../usrbg/index").default;
|
const USRBG = Vencord.Plugins.plugins.USRBG as unknown as typeof import("../usrbg/index").default;
|
||||||
url = USRBG.getImageUrl(user.id);
|
url = USRBG.getImageUrl(user.id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue