Fix UsrBG for BannersEverywhere

This commit is contained in:
thororen1234 2024-09-27 13:36:22 -04:00
parent e80b76c7f3
commit 05df3a51f1

View file

@ -15,7 +15,8 @@ import { User } from "discord-types/general";
import style from "./index.css?managed"; import style from "./index.css?managed";
interface iUSRBG extends Plugin { interface iUSRBG extends Plugin {
data: { [key: string]: string; }; userHasBackground(userId: string);
getImageUrl(userId: string): string | null;
} }
const settings = definePluginSettings({ const settings = definePluginSettings({
@ -80,8 +81,10 @@ export default definePlugin({
}, },
getBanner(userId: string): string | undefined { getBanner(userId: string): string | undefined {
if (Vencord.Plugins.isPluginEnabled("USRBG") && (Vencord.Plugins.plugins.USRBG as iUSRBG).data[userId]) { if (Vencord.Plugins.isPluginEnabled("USRBG") && (Vencord.Plugins.plugins.USRBG as iUSRBG).userHasBackground(userId)) {
return (Vencord.Plugins.plugins.USRBG as iUSRBG).data[userId]; let banner = (Vencord.Plugins.plugins.USRBG as iUSRBG).getImageUrl(userId);
if (banner === null) banner = "";
return banner;
} }
const userProfile = UserProfileStore.getUserProfile(userId); const userProfile = UserProfileStore.getUserProfile(userId);
if (userProfile?.banner) { if (userProfile?.banner) {