aboutsummaryrefslogtreecommitdiffstats
path: root/0003-Experiments-Re-add-staging-banner.patch
blob: 4beacd8e6ccd911bdf1c67d92aaaef5ebac6c79f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From e652044d200bd28b1a6fb214f2a8f33797471238 Mon Sep 17 00:00:00 2001
From: 1024x2 <2pow11@gmail.com>
Date: Thu, 26 Oct 2023 00:48:25 +0100
Subject: [PATCH 3/5] Experiments: Re-add staging banner

(it's funny)
---
 src/plugins/experiments/index.tsx | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx
index f8ea4b0..dc4f78f 100644
--- a/src/plugins/experiments/index.tsx
+++ b/src/plugins/experiments/index.tsx
@@ -33,6 +33,12 @@ const settings = definePluginSettings({
         type: OptionType.BOOLEAN,
         default: false,
         restartNeeded: true
+    },
+    forceStagingBanner: {
+        description: "Whether to force Staging banner under user area.",
+        type: OptionType.BOOLEAN,
+        default: false,
+        restartNeeded: true
     }
 });
 
@@ -77,6 +83,14 @@ export default definePlugin({
                 }
             ]
         },
+        {
+            find: ".Messages.DEV_NOTICE_STAGING",
+            predicate: () => settings.store.forceStagingBanner,
+            replacement: {
+                match: /window\.GLOBAL_ENV\.RELEASE_CHANNEL/,
+                replace: "\"staging\""
+            }
+        },
         {
             find: 'H1,title:"Experiments"',
             replacement: {
-- 
2.43.1