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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
From aea85d8787b09304b1b290985066521825ef364d Mon Sep 17 00:00:00 2001
From: Ernesto Castellotti <mail@ernestocastellotti.it>
Date: Tue, 7 Nov 2023 13:32:19 +0100
Subject: [PATCH] [PATCH] Force disable auto update
---
.../left/settings/SettingsExperimental.tsx | 8 -----
src/electron/window.ts | 9 +++---
src/global/actions/ui/misc.ts | 31 -------------------
3 files changed, 4 insertions(+), 44 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 2bec304c6..3fcc8e566 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}`);
}
diff --git a/src/global/actions/ui/misc.ts b/src/global/actions/ui/misc.ts
index e288381c4..ccece779f 100644
--- a/src/global/actions/ui/misc.ts
+++ b/src/global/actions/ui/misc.ts
@@ -614,40 +614,9 @@ addActionHandler('closeMapModal', (global, actions, payload): ActionReturnType =
});
addActionHandler('checkAppVersion', (global): ActionReturnType => {
- fetch(`${APP_VERSION_URL}?${Date.now()}`)
- .then((response) => response.text())
- .then((version) => {
- version = version.trim();
-
- if (getIsAppUpdateNeeded(version, APP_VERSION)) {
- global = getGlobal();
- global = {
- ...global,
- isAppUpdateAvailable: true,
- };
- setGlobal(global);
- }
- })
- .catch((err) => {
- if (DEBUG) {
- // eslint-disable-next-line no-console
- console.error('[checkAppVersion failed] ', err);
- }
- });
});
addActionHandler('setIsElectronUpdateAvailable', (global, action, payload): ActionReturnType => {
- global = getGlobal();
- global = {
- ...global,
- isElectronUpdateAvailable: Boolean(payload),
- };
- setGlobal(global);
-});
-
-addActionHandler('afterHangUp', (global): ActionReturnType => {
- if (!selectTabState(global, getCurrentTabId()).multitabNextAction) return;
- reestablishMasterToSelf();
});
let notificationInterval: number | undefined;
--
2.42.1
|