From e48721b1d967c3efc08127cbdfa7efc3e321ecbd Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Wed, 29 Jun 2022 16:58:24 +0100 Subject: Fix toggle for pre-release updates on Ubuntu (#393) Fixes #391 --- .../settings/settings/EditSettingsForm.js | 74 +++++++++++----------- src/electron/ipc-api/autoUpdate.ts | 3 +- src/stores/AppStore.ts | 8 +-- 3 files changed, 39 insertions(+), 46 deletions(-) diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 3ccb37494..a8fdea2fb 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js @@ -932,46 +932,44 @@ class EditSettingsForm extends Component { {automaticUpdates && ( <> - {(isMac || isWindows || process.env.APPIMAGE) && ( - <> -
- - {updateIsReadyToInstall ? ( -
+ <> +
+ + {updateIsReadyToInstall ? ( +
+

+ {intl.formatMessage(messages.currentVersion)} {ferdiumVersion} +

+ {noUpdateAvailable && (

- {intl.formatMessage(messages.currentVersion)} {ferdiumVersion} + {intl.formatMessage(messages.updateStatusUpToDate)}.

- {noUpdateAvailable && ( -

- {intl.formatMessage(messages.updateStatusUpToDate)}. -

- )} - {updateFailed && ( - -  An error occurred (check the console for more details) - - )} - - )} + )} + {updateFailed && ( + +  An error occurred (check the console for more details) + + )} + {showServicesUpdatedInfoBar ? ( <>

diff --git a/src/electron/ipc-api/autoUpdate.ts b/src/electron/ipc-api/autoUpdate.ts index fb91d3515..262d396ec 100644 --- a/src/electron/ipc-api/autoUpdate.ts +++ b/src/electron/ipc-api/autoUpdate.ts @@ -1,6 +1,5 @@ import { ipcMain, BrowserWindow } from 'electron'; import { autoUpdater } from 'electron-updater'; -import { isMac, isWindows } from '../../environment'; import { appEvents } from '../..'; const debug = require('../../preload-safe-debug')('Ferdium:ipcApi:autoUpdate'); @@ -11,7 +10,7 @@ export default (params: { mainWindow: BrowserWindow; settings: any }) => { if (!enableUpdate) { autoUpdater.autoInstallOnAppQuit = false; autoUpdater.autoDownload = false; - } else if (isMac || isWindows || process.env.APPIMAGE) { + } else { ipcMain.on('autoUpdate', (event, args) => { if (enableUpdate) { try { diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts index a949bae1d..8c8454116 100644 --- a/src/stores/AppStore.ts +++ b/src/stores/AppStore.ts @@ -21,7 +21,7 @@ import TypedStore from './lib/TypedStore'; import Request from './lib/Request'; import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; import { cleanseJSObject } from '../jsUtils'; -import { isMac, isWindows, electronVersion, osRelease } from '../environment'; +import { isMac, electronVersion, osRelease } from '../environment'; import { ferdiumVersion, userDataPath, @@ -408,11 +408,7 @@ export default class AppStore extends TypedStore { } @action _checkForUpdates() { - if ( - this.isOnline && - this.stores.settings.app.automaticUpdates && - (isMac || isWindows || process.env.APPIMAGE) - ) { + if (this.isOnline && this.stores.settings.app.automaticUpdates) { debug('_checkForUpdates: sending event to autoUpdate:check'); this.updateStatus = this.updateStatusTypes.CHECKING; ipcRenderer.send('autoUpdate', { -- cgit v1.2.3-54-g00ecf