diff --git a/src/api/PluginManager.ts b/src/api/PluginManager.ts index e86098f7a..9789b6793 100644 --- a/src/api/PluginManager.ts +++ b/src/api/PluginManager.ts @@ -383,7 +383,7 @@ export const initPluginManager = onlyOnce(function init() { "onBeforeMessageEdit", "onBeforeMessageSend", "onMessageClick", "renderMemberListDecorator", "renderMessageAccessory", "renderMessageDecoration", // Custom - "renderNicknameIcon", "renderProfileCollection", "renderProfileSection" + "renderNicknameIcon" ]; const neededApiPlugins = new Set(); @@ -430,7 +430,7 @@ export const initPluginManager = onlyOnce(function init() { if (p.renderProfileSection) neededApiPlugins.add("ProfileSectionsAPI"); for (const key of pluginKeysToBind) { - p[key] &&= p[key].bind(p) as any; + p[key] &&= (p[key] as Function).bind(p) as any; } } diff --git a/src/equicordplugins/collapsibleUi/index.tsx b/src/equicordplugins/collapsibleUi/index.tsx index 7893bcb3e..38a876ce3 100644 --- a/src/equicordplugins/collapsibleUi/index.tsx +++ b/src/equicordplugins/collapsibleUi/index.tsx @@ -131,9 +131,12 @@ export default definePlugin({ } }, ], - chatBarButtonWrapper: (buttons: ReactNode) => { - if (!Array.isArray(buttons) || buttons.length === 0) return buttons; - return ; + chatBarButtonWrapper: { + wrapper: (buttons: ReactNode) => { + if (!Array.isArray(buttons) || buttons.length === 0) return buttons; + return ; + }, + priority: 0, }, userAreaControlsClass(className: string) { diff --git a/src/equicordplugins/commandPalette/index.tsx b/src/equicordplugins/commandPalette/index.tsx index df917d822..dee25573d 100644 --- a/src/equicordplugins/commandPalette/index.tsx +++ b/src/equicordplugins/commandPalette/index.tsx @@ -229,5 +229,8 @@ export default definePlugin({ }); }, - chatBarButtonWrapper: wrapChatBarChildren, + chatBarButtonWrapper: { + wrapper: wrapChatBarChildren, + priority: 0, + }, }); diff --git a/src/equicordplugins/githubRepos/index.tsx b/src/equicordplugins/githubRepos/index.tsx index be371e203..7a14bc075 100644 --- a/src/equicordplugins/githubRepos/index.tsx +++ b/src/equicordplugins/githubRepos/index.tsx @@ -64,13 +64,16 @@ export default definePlugin({ shouldShowGitHub(userId: string) { return UserProfileStore.getUserProfile(userId)?.connectedAccounts?.some((c: any) => c.type === "github") ?? false; }, - renderProfileCollection: (props: { user: User; displayProfile?: any; }) => { - return ( - - ); + renderProfileCollection: { + render: (props: { user: User; displayProfile?: any; }) => { + return ( + + ); + }, + priority: 0, }, renderProfileRepositoriesTab: ErrorBoundary.wrap((props: { user: User; displayProfile?: any; }) => { return ( diff --git a/src/equicordplugins/hideChatButtons/index.tsx b/src/equicordplugins/hideChatButtons/index.tsx index 62a578cad..fb2b3629b 100644 --- a/src/equicordplugins/hideChatButtons/index.tsx +++ b/src/equicordplugins/hideChatButtons/index.tsx @@ -88,8 +88,11 @@ export default definePlugin({ dependencies: ["ChatInputButtonAPI"], settings: settings, startAt: StartAt.Init, - chatBarButtonWrapper: (buttons: ReactNode) => { - return ; + chatBarButtonWrapper: { + wrapper: (buttons: ReactNode) => { + return ; + }, + priority: 0, }, start() { hidechatbuttonsopen = settings.store.open; diff --git a/src/equicordplugins/songSpotlight.desktop/index.tsx b/src/equicordplugins/songSpotlight.desktop/index.tsx index b870b58db..8e9f99f40 100644 --- a/src/equicordplugins/songSpotlight.desktop/index.tsx +++ b/src/equicordplugins/songSpotlight.desktop/index.tsx @@ -58,6 +58,9 @@ export default definePlugin({ useAuthorizationStore.persist.rehydrate(); }, - renderProfileCollection: ProfileSongs, + renderProfileCollection: { + render: ProfileSongs, + priority: 0, + }, renderWidgetSongs: ErrorBoundary.wrap(WidgetSongs, { noop: true }), }); diff --git a/src/equicordplugins/voiceStats/index.tsx b/src/equicordplugins/voiceStats/index.tsx index e02f9b8e8..555904e6c 100644 --- a/src/equicordplugins/voiceStats/index.tsx +++ b/src/equicordplugins/voiceStats/index.tsx @@ -140,7 +140,10 @@ export default definePlugin({ tags: ["Voice", "Friends"], authors: [EquicordDevs.Moowi], dependencies: ["ProfileSectionsAPI"], - renderProfileSection: VoiceStatsSection, + renderProfileSection: { + render: VoiceStatsSection, + priority: 0, + }, flux: { VOICE_STATE_UPDATES({ voiceStates }: { voiceStates: VoiceState[]; }) { const myId = UserStore.getCurrentUser()?.id; diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index bc7a2ebed..798f03be0 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -76,5 +76,8 @@ export default definePlugin({ tags: ["Friends"], authors: [Devs.Elvyra, Devs.Antti], dependencies: ["ProfileSectionsAPI"], - renderProfileSection: FriendsSinceSection, + renderProfileSection: { + render: FriendsSinceSection, + priority: 0, + }, }); diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index dca4e7217..e03750482 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -137,7 +137,9 @@ export default definePlugin({ }, 4000); }, - renderProfileCollection: ({ user, isSideBar = false }: { user: User; isSideBar?: boolean; }) => { + renderProfileCollection: { + priority: 0, + render: ({ user, isSideBar = false }: { user: User; isSideBar?: boolean; }) => { const [reviewData] = useAwaiter(() => getReviews(user.id, { limit: 4 }), { deps: [user.id], fallbackValue: null }); // Discord are masters at using a crap ton of html elements and css classes to create a simple ui that could have @@ -194,5 +196,6 @@ export default definePlugin({ return isSideBar ?
{reviewsSection}
: reviewsSection; - } + }, + }, });