From b95c5c6619bdd9d2d42089d02f553a43bfb68dba Mon Sep 17 00:00:00 2001
From: Đỗ Văn Hoài Tuân <htuan03@gmail.com>
Date: Sat, 29 Apr 2023 15:08:04 -0700
Subject: Fix USRBG (#1000)

Co-authored-by: V <vendicated@riseup.net>
---
 src/plugins/usrbg/index.tsx | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

(limited to 'src/plugins/usrbg/index.tsx')

diff --git a/src/plugins/usrbg/index.tsx b/src/plugins/usrbg/index.tsx
index c898d92..09ecd57 100644
--- a/src/plugins/usrbg/index.tsx
+++ b/src/plugins/usrbg/index.tsx
@@ -46,11 +46,17 @@ export default definePlugin({
     settings,
     patches: [
         {
-            find: ".bannerSrc,",
-            replacement: {
-                match: /(\i)\.bannerSrc,/,
-                replace: "$self.useBannerHook($1),"
-            }
+            find: ".NITRO_BANNER,",
+            replacement: [
+                {
+                    match: /(\i)\.premiumType/,
+                    replace: "$self.premiumHook($1)||$&"
+                },
+                {
+                    match: /(\i)\.bannerSrc,/,
+                    replace: "$self.useBannerHook($1),"
+                }
+            ]
         }
     ],
 
@@ -65,6 +71,10 @@ export default definePlugin({
         if (data[user.id]) return data[user.id];
     },
 
+    premiumHook({ userId }: any) {
+        if (data[userId]) return 2;
+    },
+
     async start() {
         enableStyle(style);
 
-- 
cgit 

