diff --git a/materialious/electron/package-lock.json b/materialious/electron/package-lock.json index 083ba73e..a4ce25a9 100644 --- a/materialious/electron/package-lock.json +++ b/materialious/electron/package-lock.json @@ -1,12 +1,12 @@ { "name": "Materialious", - "version": "1.9.19", + "version": "1.9.20", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "Materialious", - "version": "1.9.19", + "version": "1.9.20", "license": "MIT", "dependencies": { "@capacitor-community/electron": "^5.0.0", diff --git a/materialious/electron/src/index.ts b/materialious/electron/src/index.ts index 476b8cd3..18732565 100644 --- a/materialious/electron/src/index.ts +++ b/materialious/electron/src/index.ts @@ -58,8 +58,6 @@ let allowInsecureSSL = false; setupContentSecurityPolicy(myCapacitorApp.getCustomURLScheme()); // Initialize our app, build windows, and load content. await myCapacitorApp.init(); - // Check for updates if we are in a packaged app. - autoUpdater.checkForUpdatesAndNotify(); })(); app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { @@ -167,3 +165,9 @@ ipcMain.handle('setAllowInsecureSSL', async (_, allow) => { return allowInsecureSSL; }); + +ipcMain.handle('doUpdateCheck', (_, disableAutoUpdate) => { + // Check for updates if we are in a packaged app. + autoUpdater.autoInstallOnAppQuit = !disableAutoUpdate + autoUpdater.checkForUpdatesAndNotify(); +}) diff --git a/materialious/electron/src/preload.ts b/materialious/electron/src/preload.ts index 278f9285..83144c9b 100644 --- a/materialious/electron/src/preload.ts +++ b/materialious/electron/src/preload.ts @@ -8,5 +8,6 @@ contextBridge.exposeInMainWorld('electronAPI', { ipcRenderer.invoke('generatePoToken', bgChallenge, requestKey, visitorData), setAllowInsecureSSL: async (allow: boolean) => { return await ipcRenderer.invoke('setAllowInsecureSSL', allow); - } + }, + doUpdateCheck: (disableAutoUpdate) => ipcRenderer.invoke('doUpdateCheck', disableAutoUpdate) }); diff --git a/materialious/package-lock.json b/materialious/package-lock.json index d27176be..feb32ca4 100644 --- a/materialious/package-lock.json +++ b/materialious/package-lock.json @@ -1,12 +1,12 @@ { "name": "materialious", - "version": "1.9.19", + "version": "1.9.20", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "materialious", - "version": "1.9.19", + "version": "1.9.20", "hasInstallScript": true, "dependencies": { "@capacitor-community/electron": "^5.0.1", diff --git a/materialious/src/app.d.ts b/materialious/src/app.d.ts index 753ee6b1..6848f211 100644 --- a/materialious/src/app.d.ts +++ b/materialious/src/app.d.ts @@ -19,6 +19,7 @@ declare global { visitorData: string ) => Promise; setAllowInsecureSSL: (allowInsecureSSL: boolean) => Promoise; + doUpdateCheck: (disableAutoUpdate: boolean) => Promise; }; } } diff --git a/materialious/src/lib/components/Settings/Interface.svelte b/materialious/src/lib/components/Settings/Interface.svelte index 9f17b996..310ebe23 100644 --- a/materialious/src/lib/components/Settings/Interface.svelte +++ b/materialious/src/lib/components/Settings/Interface.svelte @@ -21,6 +21,7 @@ interfaceAutoExpandComments, interfaceAutoExpandDesc, interfaceDefaultPage, + interfaceDisableAutoUpdate, interfaceForceCase, interfaceLowBandwidthMode, interfaceRegionStore, @@ -288,6 +289,24 @@ +{#if Capacitor.getPlatform() == 'electron'} +
+ +
+{/if} +