From 685f44d40ff0909a8a8fd41398bacf27a2f3228c Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 25 Oct 2023 19:22:57 +0200 Subject: [PATCH] Fix OpenInApp --- src/plugins/openInApp/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/openInApp/index.ts b/src/plugins/openInApp/index.ts index 9fd335bdc..e26a01eb9 100644 --- a/src/plugins/openInApp/index.ts +++ b/src/plugins/openInApp/index.ts @@ -53,10 +53,10 @@ export default definePlugin({ patches: [ { - find: '"MaskedLinkStore"', + find: "trackAnnouncementMessageLinkClicked({", replacement: { - match: /return ((\i)\.apply\(this,arguments\))(?=\}function \i.{0,250}\.trusted)/, - replace: "return $self.handleLink(...arguments).then(handled => handled||$1)" + match: /(?<=handleClick:function\(\)\{return (\i)\}.+?)async function \1\(.+?\)\{/, + replace: "$& if(await $self.handleLink(...arguments)) return;" } }, // Make Spotify profile activity links open in app on web @@ -71,7 +71,7 @@ export default definePlugin({ { find: ".CONNECTED_ACCOUNT_VIEWED,", replacement: { - match: /(?<=href:\i,onClick:function\(\i\)\{)(?=\i=(\i)\.type,.{0,50}CONNECTED_ACCOUNT_VIEWED)/, + match: /(?<=href:\i,onClick:\i=>\{)(?=.{0,10}\i=(\i)\.type,.{0,100}CONNECTED_ACCOUNT_VIEWED)/, replace: "$self.handleAccountView(arguments[0],$1.type,$1.id);" } }