Skip to content

Commit cbf4b68

Browse files
committed
electron: lazily read updater enabled
1 parent bd4527b commit cbf4b68

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/desktop-electron/src/renderer/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ const createPlatform = (): Platform => {
152152
storage,
153153

154154
checkUpdate: async () => {
155-
if (!UPDATER_ENABLED) return { updateAvailable: false }
155+
if (!UPDATER_ENABLED()) return { updateAvailable: false }
156156
return window.api.checkUpdate()
157157
},
158158

159159
update: async () => {
160-
if (!UPDATER_ENABLED) return
160+
if (!UPDATER_ENABLED()) return
161161
await window.api.installUpdate()
162162
},
163163

packages/desktop-electron/src/renderer/updater.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { initI18n, t } from "./i18n"
22

3-
export const UPDATER_ENABLED = window.__OPENCODE__?.updaterEnabled ?? false
3+
export const UPDATER_ENABLED = () => window.__OPENCODE__?.updaterEnabled ?? false
44

55
export async function runUpdater({ alertOnFail }: { alertOnFail: boolean }) {
66
await initI18n()

0 commit comments

Comments
 (0)