From 87ae988d5d2dff445ddb7db0e3d675b29a870a4d Mon Sep 17 00:00:00 2001 From: kytwb Date: Wed, 5 Jan 2022 19:13:39 +0100 Subject: #512 Restrict in-app update to Mac, Windows and AppImage --- .../settings/settings/EditSettingsForm.js | 78 ++++++++++++---------- src/stores/AppStore.js | 11 +-- 2 files changed, 47 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index c113bd9eb..24ba644f4 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js @@ -768,46 +768,50 @@ class EditSettingsForm extends Component { {this.state.activeSetttingsTab === 'updates' && (
- {automaticUpdates && ( -
- - {updateIsReadyToInstall ? ( -
- )} -

- {intl.formatMessage(messages.currentVersion)} {ferdiVersion} -

- {noUpdateAvailable && ( + {(isMac || isWindows || process.env.APPIMAGE) && ( <> -
-
- {intl.formatMessage(messages.updateStatusUpToDate)}. + {automaticUpdates && ( + <> +
+ + {updateIsReadyToInstall ? ( +
+

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

+ {noUpdateAvailable && ( +

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

+ )} + {updateFailed && ( + + An error occured (check the console for more details) + + )} + + )} )} - {updateFailed && ( - - An error occured (check the console for more details) - - )}

Ferdi is based on{' '} diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index fd7c58dfc..54a3e4d92 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -17,7 +17,7 @@ import { readJsonSync } from 'fs-extra'; import Store from './lib/Store'; import Request from './lib/Request'; import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; -import { isMac, electronVersion, osRelease } from '../environment'; +import { isMac, isWindows, electronVersion, osRelease } from '../environment'; import { ferdiVersion, userDataPath, ferdiLocale } from '../environment-remote'; import { generatedTranslations } from '../i18n/translations'; import { getLocale } from '../helpers/i18n-helpers'; @@ -382,15 +382,16 @@ export default class AppStore extends Store { } @action _checkForUpdates() { - if (this.isOnline) { + if (this.isOnline && this.stores.settings.app.automaticUpdates && (isMac || isWindows || process.env.APPIMAGE)) { debug('_checkForUpdates: sending event to autoUpdate:check'); this.updateStatus = this.updateStatusTypes.CHECKING; ipcRenderer.send('autoUpdate', { action: 'check', }); - if (this.stores.settings.app.automaticUpdates) { - this.actions.recipe.update(); - } + } + + if (this.isOnline && this.stores.settings.app.automaticUpdates) { + this.actions.recipe.update(); } } -- cgit v1.2.3-70-g09d2