summarylogtreecommitdiffstats
path: root/force-disable-auto-update.patch
blob: 72724b85db6383b10d97654bb2d93368b1a37b60 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
From 5f6055e812a4b069e67d14ccc17c5f40ed38da1f Mon Sep 17 00:00:00 2001
From: Ernesto Castellotti <mail@ernestocastellotti.it>
Date: Sat, 28 Oct 2023 23:03:06 +0200
Subject: [PATCH] Force disable auto update

---
 src/components/left/settings/SettingsExperimental.tsx | 8 --------
 src/electron/window.ts                                | 9 ++++-----
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/components/left/settings/SettingsExperimental.tsx b/src/components/left/settings/SettingsExperimental.tsx
index c4ee07962..5edbfdea1 100644
--- a/src/components/left/settings/SettingsExperimental.tsx
+++ b/src/components/left/settings/SettingsExperimental.tsx
@@ -120,14 +120,6 @@ const SettingsExperimental: FC<OwnProps & StateProps> = ({
           onCheck={() => setSettingOption({ shouldDebugExportedSenders: !shouldDebugExportedSenders })}
         />
 
-        {IS_ELECTRON && (
-          <Checkbox
-            label="Enable autoupdates"
-            checked={Boolean(isAutoUpdateEnabled)}
-            onCheck={handleIsAutoUpdateEnabledChange}
-          />
-        )}
-
         <ListItem
           // eslint-disable-next-line react/jsx-no-bind
           onClick={handleDownloadLog}
diff --git a/src/electron/window.ts b/src/electron/window.ts
index bbf264c8d..dd27dd784 100644
--- a/src/electron/window.ts
+++ b/src/electron/window.ts
@@ -139,16 +139,15 @@ export function createWindow(url?: string) {
 }
 
 function loadWindowUrl(window: BrowserWindow, url?: string, hash?: string): void {
+  if (getIsAutoUpdateEnabled()) {
+    store.set(AUTO_UPDATE_SETTING_KEY, false);
+  }
+
   if (url) {
     window.loadURL(url);
   } else if (!app.isPackaged) {
     window.loadURL(`http://localhost:1234${hash}`);
     window.webContents.openDevTools();
-  } else if (getIsAutoUpdateEnabled()) {
-    window.loadURL(`${process.env.BASE_URL}${hash}`);
-  } else if (getIsAutoUpdateEnabled() === undefined && IS_FIRST_RUN) {
-    store.set(AUTO_UPDATE_SETTING_KEY, true);
-    window.loadURL(`${process.env.BASE_URL}${hash}`);
   } else {
     window.loadURL(`file://${__dirname}/index.html${hash}`);
   }
-- 
2.42.0