Merge auto update disable

This commit is contained in:
WardPearce
2025-07-21 14:36:24 +12:00
5 changed files with 42 additions and 2 deletions
+14 -2
View File
@@ -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,17 @@ ipcMain.handle('setAllowInsecureSSL', async (_, allow) => {
return allowInsecureSSL;
});
ipcMain.handle('doUpdateCheck', async (_, disableAutoUpdate) => {
// Check for updates if we are in a packaged app.
autoUpdater.autoInstallOnAppQuit = !disableAutoUpdate;
if (disableAutoUpdate) {
await autoUpdater.checkForUpdatesAndNotify({
title: 'Update Available',
body: 'A new version is available.'
});
} else {
await autoUpdater.checkForUpdatesAndNotify();
}
});
@@ -21,6 +21,7 @@
interfaceAutoExpandComments,
interfaceAutoExpandDesc,
interfaceDefaultPage,
interfaceDisableAutoUpdate,
interfaceForceCase,
interfaceLowBandwidthMode,
interfaceRegionStore,
@@ -110,6 +111,12 @@
}
});
if (Capacitor.getPlatform() === 'electron') {
interfaceDisableAutoUpdate.subscribe((isDisabled) => {
window.electronAPI.doUpdateCheck(isDisabled);
});
}
let pages: Pages = $state([]);
authStore.subscribe(() => {
pages = getPages();
@@ -288,6 +295,24 @@
</nav>
</div>
{#if Capacitor.getPlatform() == 'electron'}
<div class="field no-margin">
<nav class="no-padding">
<div class="max">
<div>{$_('layout.disableAutoUpdate')}</div>
</div>
<label class="switch" tabindex="0" role="switch">
<input
type="checkbox"
bind:checked={$interfaceDisableAutoUpdate}
onclick={() => interfaceDisableAutoUpdate.set(!$interfaceDisableAutoUpdate)}
/>
<span></span>
</label>
</nav>
</div>
{/if}
<div class="field label suffix border">
<select
tabindex="0"
@@ -124,6 +124,7 @@
"previewVideoOnHover": "Video-Vorschau beim Hovern",
"expandDescription": "Beschreibung standardmäßig erweitern",
"expandComments": "Kommentare standardmäßig erweitern",
"disableAutoUpdate": "Automatische Installation von Updates deaktivieren",
"dataPreferences": {
"content": "Du möchtest Abonnements importieren/exportieren, dein Passwort ändern oder dein Konto löschen? Klicke hier und scrolle bis zum Ende der Seite.",
"dataPreferences": "Dateneinstellungen"
@@ -136,6 +136,7 @@
"expandChapters": "Expand chapters by default",
"expandComments": "Expand comments by default",
"allowInsecureRequests": "Allow insecure requests",
"disableAutoUpdate": "Disable automatic updates",
"dataPreferences": {
"content": "Looking to import/export subscriptions, change password or delete account? Click here and scroll to the bottom of the page.",
"dataPreferences": "Data preferences"
+1
View File
@@ -92,6 +92,7 @@ export const interfaceDisplayThumbnailAvatars = persisted('disableThumbnailAvata
export const interfaceDefaultPage = persisted('defaultPage', '/');
export const interfaceSearchHistoryEnabled = persisted('searchHistoryEnabled', false);
export const interfaceAllowInsecureRequests = persisted('allowInsecureRequests', false);
export const interfaceDisableAutoUpdate = persisted('disableAutoUpdate', false)
export const sponsorBlockStore = persisted('sponsorBlock', true);
export const sponsorBlockUrlStore: Writable<string | null | undefined> = persisted(