From 19361ef7901bb016948324190f4c68783c63b780 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:52:35 -0500 Subject: [PATCH 1/2] BadgeApi, AccountPanelServerProfile: Fix not working (#3147) --- src/plugins/_api/badges/index.tsx | 2 +- src/plugins/accountPanelServerProfile/index.tsx | 12 ++++++------ src/plugins/fullUserInChatbox/index.tsx | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/_api/badges/index.tsx b/src/plugins/_api/badges/index.tsx index d02b5e1d..acdfb1f1 100644 --- a/src/plugins/_api/badges/index.tsx +++ b/src/plugins/_api/badges/index.tsx @@ -79,7 +79,7 @@ export default definePlugin({ replace: "...$1.props,$& $1.image??" }, { - match: /(?<=text:(\i)\.description,.{0,200})children:/, + match: /(?<="aria-label":(\i)\.description,.{0,200})children:/, replace: "children:$1.component ? $self.renderBadgeComponent({ ...$1 }) :" }, // conditionally override their onClick with badge.onClick if it exists diff --git a/src/plugins/accountPanelServerProfile/index.tsx b/src/plugins/accountPanelServerProfile/index.tsx index 1b468a6d..b6218bf5 100644 --- a/src/plugins/accountPanelServerProfile/index.tsx +++ b/src/plugins/accountPanelServerProfile/index.tsx @@ -16,7 +16,7 @@ import { User } from "discord-types/general"; interface UserProfileProps { popoutProps: Record; currentUser: User; - originalPopout: () => React.ReactNode; + OriginalPopout: () => React.ReactNode; } const UserProfile = findComponentByCodeLazy("UserProfilePopoutWrapper: user cannot be undefined"); @@ -73,12 +73,12 @@ export default definePlugin({ group: true, replacement: [ { - match: /(?<=\.SIZE_32\)}\);)/, + match: /(?<=\.AVATAR_SIZE\);)/, replace: "$self.useAccountPanelRef();" }, { match: /(\.AVATAR,children:.+?renderPopout:(\i)=>){(.+?)}(?=,position)(?<=currentUser:(\i).+?)/, - replace: (_, rest, popoutProps, originalPopout, currentUser) => `${rest}$self.UserProfile({popoutProps:${popoutProps},currentUser:${currentUser},originalPopout:()=>{${originalPopout}}})` + replace: (_, rest, popoutProps, originalPopout, currentUser) => `${rest}$self.UserProfile({popoutProps:${popoutProps},currentUser:${currentUser},OriginalPopout:()=>{${originalPopout}}})` }, { match: /\.AVATAR,children:.+?(?=renderPopout:)/, @@ -112,17 +112,17 @@ export default definePlugin({ openAlternatePopout = false; }, - UserProfile: ErrorBoundary.wrap(({ popoutProps, currentUser, originalPopout }: UserProfileProps) => { + UserProfile: ErrorBoundary.wrap(({ popoutProps, currentUser, OriginalPopout }: UserProfileProps) => { if ( (settings.store.prioritizeServerProfile && openAlternatePopout) || (!settings.store.prioritizeServerProfile && !openAlternatePopout) ) { - return originalPopout(); + return ; } const currentChannel = getCurrentChannel(); if (currentChannel?.getGuildId() == null) { - return originalPopout(); + return ; } return ( diff --git a/src/plugins/fullUserInChatbox/index.tsx b/src/plugins/fullUserInChatbox/index.tsx index 792f0419..4bcc95b6 100644 --- a/src/plugins/fullUserInChatbox/index.tsx +++ b/src/plugins/fullUserInChatbox/index.tsx @@ -16,7 +16,7 @@ interface UserMentionComponentProps { id: string; channelId: string; guildId: string; - OriginalComponent: ReactNode; + OriginalComponent: () => ReactNode; } export default definePlugin({ @@ -29,7 +29,7 @@ export default definePlugin({ find: ':"text":', replacement: { match: /(hidePersonalInformation\).+?)(if\(null!=\i\){.+?return \i)(?=})/, - replace: "$1return $self.UserMentionComponent({...arguments[0],OriginalComponent:(()=>{$2})()});" + replace: "$1return $self.UserMentionComponent({...arguments[0],OriginalComponent:()=>{$2}});" } } ], @@ -42,6 +42,6 @@ export default definePlugin({ channelId={props.channelId} /> ), { - fallback: ({ wrappedProps }) => wrappedProps.OriginalComponent + fallback: ({ wrappedProps: { OriginalComponent } }) => }) }); From 88e3bc037d0f6c366faf7897c16dbd4cad053dc0 Mon Sep 17 00:00:00 2001 From: Sqaaakoi Date: Sun, 19 Jan 2025 09:05:20 +1300 Subject: [PATCH 2/2] ConsoleShortcuts: Set FluxStore toStringTag to store name (#3144) --- src/plugins/consoleShortcuts/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/consoleShortcuts/index.ts b/src/plugins/consoleShortcuts/index.ts index 25d48f1d..be23d37c 100644 --- a/src/plugins/consoleShortcuts/index.ts +++ b/src/plugins/consoleShortcuts/index.ts @@ -179,6 +179,16 @@ export default definePlugin({ description: "Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.", authors: [Devs.Ven], + patches: [ + { + find: 'this,"_changeCallbacks",', + replacement: { + match: /\i\(this,"_changeCallbacks",/, + replace: "Reflect.defineProperty(this,Symbol.toStringTag,{value:this.getName(),configurable:!0,writable:!0,enumerable:!1}),$&" + } + } + ], + startAt: StartAt.Init, start() { const shortcuts = makeShortcuts();