[MM-30713] Stop Linux and Windows app from minimizing/hiding without user warning (#1988)

* [MM-30713] Stop Linux app from minimizing/hiding without user warning

* Added same behaviour for Windows

* Update messages

* Change wording

* Fix for accidentally disabled setting
This commit is contained in:
Devin Binnie
2022-03-01 12:35:27 -05:00
committed by GitHub
parent 062ca92f31
commit fc13f877f2
7 changed files with 140 additions and 13 deletions

View File

@@ -214,7 +214,7 @@ export default class SettingsPage extends React.PureComponent<Record<string, nev
}
handleChangeMinimizeToTray = () => {
const shouldMinimizeToTray = this.state.showTrayIcon && this.minimizeToTrayRef.current?.checked;
const shouldMinimizeToTray = (process.platform === 'win32' || this.state.showTrayIcon) && this.minimizeToTrayRef.current?.checked;
window.timers.setImmediate(this.saveSetting, CONFIG_TYPE_APP_OPTIONS, {key: 'minimizeToTray', data: shouldMinimizeToTray});
this.setState({
@@ -691,7 +691,7 @@ export default class SettingsPage extends React.PureComponent<Record<string, nev
type='checkbox'
id='inputMinimizeToTray'
ref={this.minimizeToTrayRef}
disabled={!this.state.showTrayIcon}
disabled={process.platform !== 'win32' && !this.state.showTrayIcon}
checked={this.state.minimizeToTray}
onChange={this.handleChangeMinimizeToTray}
/>