From c65bec3e5ccfaa8cdd8a864a7f9b70aba9ddab1e Mon Sep 17 00:00:00 2001 From: kytwb Date: Fri, 24 Dec 2021 13:02:29 +0100 Subject: #2359 Disable available updates behaviour based on automaticUpdates --- src/components/layout/AppLayout.js | 4 ++-- src/components/layout/Sidebar.js | 14 ++++++++------ src/stores/AppStore.js | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index eb36ea431..4474fe0f4 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js @@ -126,7 +126,7 @@ class AppLayout extends Component { const { intl } = this.props; - const { locked } = settings.app; + const { locked, automaticUpdates } = settings.app; if (locked) { return ; } @@ -191,7 +191,7 @@ class AppLayout extends Component { {intl.formatMessage(messages.servicesUpdated)} )} - {appUpdateIsDownloaded && this.state.shouldShowAppUpdateInfoBar && ( + {automaticUpdates && appUpdateIsDownloaded && this.state.shouldShowAppUpdateInfoBar && ( { diff --git a/src/components/layout/Sidebar.js b/src/components/layout/Sidebar.js index e3df9c2ea..1cbdcfe46 100644 --- a/src/components/layout/Sidebar.js +++ b/src/components/layout/Sidebar.js @@ -233,12 +233,14 @@ class Sidebar extends Component { )} (${settingsShortcutKey(false)})`} > - {(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.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.state.tooltipEnabled && ( diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index eca347153..2698749fc 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -164,7 +164,7 @@ export default class AppStore extends Store { ipcRenderer.on('autoUpdate', (event, data) => { if (data.available) { this.updateStatus = this.updateStatusTypes.AVAILABLE; - if (isMac) { + if (isMac && this.stores.settings.app.automaticUpdates) { app.dock.bounce(); } } @@ -175,7 +175,7 @@ export default class AppStore extends Store { if (data.downloaded) { this.updateStatus = this.updateStatusTypes.DOWNLOADED; - if (isMac) { + if (isMac && this.stores.settings.app.automaticUpdates) { app.dock.bounce(); } } -- cgit v1.2.3-70-g09d2