From 7bffdc7f81dd365858003764beb3a921e6e043e7 Mon Sep 17 00:00:00 2001 From: kytwb Date: Wed, 5 Jan 2022 18:18:55 +0100 Subject: Link showServicesUpdatedInfoBar to automaticUpdates --- src/components/layout/AppLayout.js | 6 ++---- src/components/layout/Sidebar.js | 7 ++++--- src/components/settings/navigation/SettingsNavigation.js | 4 ++-- src/components/settings/settings/EditSettingsForm.js | 3 ++- src/containers/layout/AppLayoutContainer.js | 2 +- src/containers/settings/EditSettingsScreen.js | 1 + src/stores/AppStore.js | 5 +++-- 7 files changed, 15 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index 4474fe0f4..5d7b6b85c 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -87,7 +87,6 @@ class AppLayout extends Component { showServicesUpdatedInfoBar: PropTypes.bool.isRequired, appUpdateIsDownloaded: PropTypes.bool.isRequired, authRequestFailed: PropTypes.bool.isRequired, - reloadServicesAfterUpdate: PropTypes.func.isRequired, installAppUpdate: PropTypes.func.isRequired, showRequiredRequestsError: PropTypes.bool.isRequired, areRequiredRequestsSuccessful: PropTypes.bool.isRequired, @@ -115,7 +114,6 @@ class AppLayout extends Component { showServicesUpdatedInfoBar, appUpdateIsDownloaded, authRequestFailed, - reloadServicesAfterUpdate, installAppUpdate, settings, showRequiredRequestsError, @@ -175,12 +173,12 @@ class AppLayout extends Component { {intl.formatMessage(messages.authRequestFailed)} )} - {showServicesUpdatedInfoBar && + {automaticUpdates && showServicesUpdatedInfoBar && this.state.shouldShowServicesUpdatedInfoBar && ( window.location.reload()} onHide={() => { this.setState({ shouldShowServicesUpdatedInfoBar: false, diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index 1cbdcfe46..3e24c9230 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js @@ -74,6 +74,7 @@ class Sidebar extends Component { toggleNotifications: PropTypes.func.isRequired, toggleAudio: PropTypes.func.isRequired, toggleDarkMode: PropTypes.func.isRequired, + showServicesUpdatedInfoBar: PropTypes.bool.isRequired, showMessageBadgeWhenMutedSetting: PropTypes.bool.isRequired, showServiceNameSetting: PropTypes.bool.isRequired, showMessageBadgesEvenWhenMuted: PropTypes.bool.isRequired, @@ -234,10 +235,10 @@ class Sidebar extends Component { > { - (this.props.stores.settings.app.automaticUpdates && + this.props.stores.settings.app.automaticUpdates && (this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.AVAILABLE || - this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.DOWNLOADED) - ) && ( + this.props.stores.app.updateStatus === this.props.stores.app.updateStatusTypes.DOWNLOADED || + this.props.showServicesUpdatedInfoBar) && ( ) } diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js index b58956f51..763f4e8a7 100644 --- a/src/components/settings/navigation/SettingsNavigation.js +++ b/src/components/settings/navigation/SettingsNavigation.js @@ -137,9 +137,9 @@ class SettingsNavigation extends Component { activeClassName="is-active" > {intl.formatMessage(globalMessages.settings)} - {stores.settings.app.automaticUpdates && + {stores.settings.app.automaticUpdates && (stores.ui.showServicesUpdatedInfoBar || (stores.app.updateStatus === stores.app.updateStatusTypes.AVAILABLE || - stores.app.updateStatus === stores.app.updateStatusTypes.DOWNLOADED) && ( + stores.app.updateStatus === stores.app.updateStatusTypes.DOWNLOADED)) && ( )} diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index b358a395f..c3ff5cc1c 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js @@ -243,6 +243,7 @@ class EditSettingsForm extends Component { noUpdateAvailable, updateIsReadyToInstall, updateFailed, + showServicesUpdatedInfoBar, isClearingAllCache, onClearAllCache, getCacheSize, @@ -378,7 +379,7 @@ class EditSettingsForm extends Component { }} > {intl.formatMessage(messages.headlineUpdates)} - {automaticUpdates && (updateIsReadyToInstall || isUpdateAvailable) && ( + {automaticUpdates && (updateIsReadyToInstall || isUpdateAvailable || showServicesUpdatedInfoBar) && ( )} } diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 4bcd17409..45dd7d75d 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -127,6 +127,7 @@ class AppLayoutContainer extends Component { toggleMuteApp={toggleMuteApp} toggleWorkspaceDrawer={workspaceActions.toggleWorkspaceDrawer} isWorkspaceDrawerOpen={workspaceStore.isWorkspaceDrawerOpen} + showServicesUpdatedInfoBar={ui.showServicesUpdatedInfoBar} showMessageBadgeWhenMutedSetting={ settings.all.app.showMessageBadgeWhenMuted } @@ -165,7 +166,6 @@ class AppLayoutContainer extends Component { sidebar={sidebar} workspacesDrawer={workspacesDrawer} services={servicesContainer} - reloadServicesAfterUpdate={() => window.location.reload()} installAppUpdate={installUpdate} globalError={globalError.error} showRequiredRequestsError={requests.showRequiredRequestsError} diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 78a0eac6f..eff5f20ff 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js @@ -728,6 +728,7 @@ class EditSettingsScreen extends Component { noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE} updateIsReadyToInstall={updateStatus === updateStatusTypes.DOWNLOADED} updateFailed={updateStatus === updateStatusTypes.FAILED} + showServicesUpdatedInfoBar={this.props.stores.ui.showServicesUpdatedInfoBar} onSubmit={d => this.onSubmit(d)} getCacheSize={() => app.cacheSize} isClearingAllCache={isClearingAllCache} diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index cdb8586ca..fd7c58dfc 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -388,8 +388,9 @@ export default class AppStore extends Store { ipcRenderer.send('autoUpdate', { action: 'check', }); - - this.actions.recipe.update(); + if (this.stores.settings.app.automaticUpdates) { + this.actions.recipe.update(); + } } } -- cgit v1.2.3-54-g00ecf