diff options
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 74 | ||||
-rw-r--r-- | src/electron/ipc-api/autoUpdate.ts | 3 | ||||
-rw-r--r-- | 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 { | |||
932 | <Toggle field={form.$('automaticUpdates')} /> | 932 | <Toggle field={form.$('automaticUpdates')} /> |
933 | {automaticUpdates && ( | 933 | {automaticUpdates && ( |
934 | <> | 934 | <> |
935 | {(isMac || isWindows || process.env.APPIMAGE) && ( | 935 | <> |
936 | <> | 936 | <div> |
937 | <div> | 937 | <Toggle field={form.$('beta')} /> |
938 | <Toggle field={form.$('beta')} /> | 938 | {updateIsReadyToInstall ? ( |
939 | {updateIsReadyToInstall ? ( | 939 | <Button |
940 | <Button | 940 | label={intl.formatMessage(messages.buttonInstallUpdate)} |
941 | label={intl.formatMessage(messages.buttonInstallUpdate)} | 941 | onClick={installUpdate} |
942 | onClick={installUpdate} | 942 | /> |
943 | /> | 943 | ) : ( |
944 | ) : ( | 944 | <Button |
945 | <Button | 945 | buttonType="secondary" |
946 | buttonType="secondary" | 946 | label={intl.formatMessage(updateButtonLabelMessage)} |
947 | label={intl.formatMessage(updateButtonLabelMessage)} | 947 | onClick={checkForUpdates} |
948 | onClick={checkForUpdates} | 948 | disabled={ |
949 | disabled={ | 949 | !automaticUpdates || |
950 | !automaticUpdates || | 950 | isCheckingForUpdates || |
951 | isCheckingForUpdates || | 951 | isUpdateAvailable || |
952 | isUpdateAvailable || | 952 | !isOnline |
953 | !isOnline | 953 | } |
954 | } | 954 | loaded={!isCheckingForUpdates || !isUpdateAvailable} |
955 | loaded={!isCheckingForUpdates || !isUpdateAvailable} | 955 | /> |
956 | /> | 956 | )} |
957 | )} | 957 | <br /> |
958 | <br /> | 958 | </div> |
959 | </div> | 959 | <p> |
960 | {intl.formatMessage(messages.currentVersion)} {ferdiumVersion} | ||
961 | </p> | ||
962 | {noUpdateAvailable && ( | ||
960 | <p> | 963 | <p> |
961 | {intl.formatMessage(messages.currentVersion)} {ferdiumVersion} | 964 | {intl.formatMessage(messages.updateStatusUpToDate)}. |
962 | </p> | 965 | </p> |
963 | {noUpdateAvailable && ( | 966 | )} |
964 | <p> | 967 | {updateFailed && ( |
965 | {intl.formatMessage(messages.updateStatusUpToDate)}. | 968 | <Infobox type="danger" icon="alert"> |
966 | </p> | 969 | An error occurred (check the console for more details) |
967 | )} | 970 | </Infobox> |
968 | {updateFailed && ( | 971 | )} |
969 | <Infobox type="danger" icon="alert"> | 972 | </> |
970 | An error occurred (check the console for more details) | ||
971 | </Infobox> | ||
972 | )} | ||
973 | </> | ||
974 | )} | ||
975 | {showServicesUpdatedInfoBar ? ( | 973 | {showServicesUpdatedInfoBar ? ( |
976 | <> | 974 | <> |
977 | <p> | 975 | <p> |
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 @@ | |||
1 | import { ipcMain, BrowserWindow } from 'electron'; | 1 | import { ipcMain, BrowserWindow } from 'electron'; |
2 | import { autoUpdater } from 'electron-updater'; | 2 | import { autoUpdater } from 'electron-updater'; |
3 | import { isMac, isWindows } from '../../environment'; | ||
4 | import { appEvents } from '../..'; | 3 | import { appEvents } from '../..'; |
5 | 4 | ||
6 | const debug = require('../../preload-safe-debug')('Ferdium:ipcApi:autoUpdate'); | 5 | const debug = require('../../preload-safe-debug')('Ferdium:ipcApi:autoUpdate'); |
@@ -11,7 +10,7 @@ export default (params: { mainWindow: BrowserWindow; settings: any }) => { | |||
11 | if (!enableUpdate) { | 10 | if (!enableUpdate) { |
12 | autoUpdater.autoInstallOnAppQuit = false; | 11 | autoUpdater.autoInstallOnAppQuit = false; |
13 | autoUpdater.autoDownload = false; | 12 | autoUpdater.autoDownload = false; |
14 | } else if (isMac || isWindows || process.env.APPIMAGE) { | 13 | } else { |
15 | ipcMain.on('autoUpdate', (event, args) => { | 14 | ipcMain.on('autoUpdate', (event, args) => { |
16 | if (enableUpdate) { | 15 | if (enableUpdate) { |
17 | try { | 16 | 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'; | |||
21 | import Request from './lib/Request'; | 21 | import Request from './lib/Request'; |
22 | import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; | 22 | import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; |
23 | import { cleanseJSObject } from '../jsUtils'; | 23 | import { cleanseJSObject } from '../jsUtils'; |
24 | import { isMac, isWindows, electronVersion, osRelease } from '../environment'; | 24 | import { isMac, electronVersion, osRelease } from '../environment'; |
25 | import { | 25 | import { |
26 | ferdiumVersion, | 26 | ferdiumVersion, |
27 | userDataPath, | 27 | userDataPath, |
@@ -408,11 +408,7 @@ export default class AppStore extends TypedStore { | |||
408 | } | 408 | } |
409 | 409 | ||
410 | @action _checkForUpdates() { | 410 | @action _checkForUpdates() { |
411 | if ( | 411 | if (this.isOnline && this.stores.settings.app.automaticUpdates) { |
412 | this.isOnline && | ||
413 | this.stores.settings.app.automaticUpdates && | ||
414 | (isMac || isWindows || process.env.APPIMAGE) | ||
415 | ) { | ||
416 | debug('_checkForUpdates: sending event to autoUpdate:check'); | 412 | debug('_checkForUpdates: sending event to autoUpdate:check'); |
417 | this.updateStatus = this.updateStatusTypes.CHECKING; | 413 | this.updateStatus = this.updateStatusTypes.CHECKING; |
418 | ipcRenderer.send('autoUpdate', { | 414 | ipcRenderer.send('autoUpdate', { |