mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-12 19:59:00 +00:00
electron: lazily read updater enabled
This commit is contained in:
@@ -152,12 +152,12 @@ const createPlatform = (): Platform => {
|
|||||||
storage,
|
storage,
|
||||||
|
|
||||||
checkUpdate: async () => {
|
checkUpdate: async () => {
|
||||||
if (!UPDATER_ENABLED) return { updateAvailable: false }
|
if (!UPDATER_ENABLED()) return { updateAvailable: false }
|
||||||
return window.api.checkUpdate()
|
return window.api.checkUpdate()
|
||||||
},
|
},
|
||||||
|
|
||||||
update: async () => {
|
update: async () => {
|
||||||
if (!UPDATER_ENABLED) return
|
if (!UPDATER_ENABLED()) return
|
||||||
await window.api.installUpdate()
|
await window.api.installUpdate()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { initI18n, t } from "./i18n"
|
import { initI18n, t } from "./i18n"
|
||||||
|
|
||||||
export const UPDATER_ENABLED = window.__OPENCODE__?.updaterEnabled ?? false
|
export const UPDATER_ENABLED = () => window.__OPENCODE__?.updaterEnabled ?? false
|
||||||
|
|
||||||
export async function runUpdater({ alertOnFail }: { alertOnFail: boolean }) {
|
export async function runUpdater({ alertOnFail }: { alertOnFail: boolean }) {
|
||||||
await initI18n()
|
await initI18n()
|
||||||
|
|||||||
Reference in New Issue
Block a user