From b4e4085382870bf062fe3f306b7b5b54ceb36cb1 Mon Sep 17 00:00:00 2001 From: sadan <117494111+sadan4@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:18:26 -0400 Subject: [PATCH] fix patch modifying the user object --- src/plugins/emoteCloner/index.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/plugins/emoteCloner/index.tsx b/src/plugins/emoteCloner/index.tsx index 130dd537f..539d34f7c 100644 --- a/src/plugins/emoteCloner/index.tsx +++ b/src/plugins/emoteCloner/index.tsx @@ -383,13 +383,11 @@ interface HangStatus { } } const vcHangStatusContextPatch: NavContextMenuPatchCallback =(children, props: { - user: { - HangStatus?: HangStatus - } + hangStatusActivity?: HangStatus }) => { - if(props.user.HangStatus?.emoji?.id){ - const e = props.user.HangStatus.emoji as Emoji; - e.isAnimated = props.user.HangStatus.emoji.animated ?? false; + if(props.hangStatusActivity?.emoji?.id){ + const e = props.hangStatusActivity.emoji as Emoji; + e.isAnimated = props.hangStatusActivity.emoji.animated ?? false; children.push(buildMenuItem("Emoji", () => { return e; })); @@ -409,12 +407,11 @@ export default definePlugin({ patches: [ // needed to pass the HangStatus to the context menu { - find: "renderPrioritySpeaker", + find: "canWatchStream", replacement: { - match: /(handleContextMenu".*?)(let)/, - replace: "$1this.props.user.HangStatus=this.props.hangStatusActivity;$2" - + match: /Menu".*?\.\.\.\i,/, + replace: "$&hangStatusActivity:this.props.hangStatusActivity," } - }, + } ], });