From fe19fe51d45b627105da7bf8c7e2b28779a25391 Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Wed, 29 Sep 2021 11:46:49 -0400 Subject: [PATCH] [MM-38695] Fixed minimize to tray setting on Linux (#1767) * [MM-38695] Fixed minimize to tray setting on Linux * Lint fix --- src/renderer/components/SettingsPage.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/renderer/components/SettingsPage.tsx b/src/renderer/components/SettingsPage.tsx index 8e69340e..1e3c8801 100644 --- a/src/renderer/components/SettingsPage.tsx +++ b/src/renderer/components/SettingsPage.tsx @@ -36,7 +36,6 @@ type ConfigType = typeof CONFIG_TYPE_SERVERS | typeof CONFIG_TYPE_APP_OPTIONS; type State = DeepPartial & { ready: boolean; maximized?: boolean; - trayWasVisible?: boolean; savingState: SavingStateItems; userOpenedDownloadDialog: boolean; allowSaveSpellCheckerURL: boolean; @@ -122,7 +121,6 @@ export default class SettingsPage extends React.PureComponent, currentState: Partial = {}) => { const newState = Object.assign({} as State, configData); - newState.trayWasVisible = currentState.trayWasVisible || false; newState.savingState = currentState.savingState || { appOptions: SavingState.SAVING_STATE_DONE, servers: SavingState.SAVING_STATE_DONE, @@ -207,7 +205,7 @@ export default class SettingsPage extends React.PureComponent { - const shouldMinimizeToTray = this.state.showTrayIcon && !this.minimizeToTrayRef.current?.checked; + const shouldMinimizeToTray = this.state.showTrayIcon && this.minimizeToTrayRef.current?.checked; window.timers.setImmediate(this.saveSetting, CONFIG_TYPE_APP_OPTIONS, {key: 'minimizeToTray', data: shouldMinimizeToTray}); this.setState({ @@ -642,18 +640,20 @@ export default class SettingsPage extends React.PureComponent + {'Leave app running in notification area when application window is closed'} {'If enabled, the app stays running in the notification area after app window is closed.'} - {this.state.trayWasVisible || !this.state.showTrayIcon ? '' : ' Setting takes effect after restarting the app.'} + {this.state.showTrayIcon ? ' Setting takes effect after restarting the app.' : ''} ); }