Remove unsupported auto-launch setting on Linux
This commit is contained in:
parent
58294eed00
commit
8f0731d498
5 changed files with 37 additions and 8 deletions
|
@ -152,12 +152,14 @@
|
||||||
window.setSpellCheck(val);
|
window.setSpellCheck(val);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (Settings.isAutoLaunchSupported()) {
|
||||||
new CheckboxView({
|
new CheckboxView({
|
||||||
el: this.$('.auto-launch-setting'),
|
el: this.$('.auto-launch-setting'),
|
||||||
name: 'auto-launch-setting',
|
name: 'auto-launch-setting',
|
||||||
value: window.initialData.autoLaunch,
|
value: window.initialData.autoLaunch,
|
||||||
setFn: window.setAutoLaunch,
|
setFn: window.setAutoLaunch,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
if (Settings.isHideMenuBarSupported()) {
|
if (Settings.isHideMenuBarSupported()) {
|
||||||
new CheckboxView({
|
new CheckboxView({
|
||||||
el: this.$('.menu-bar-setting'),
|
el: this.$('.menu-bar-setting'),
|
||||||
|
@ -230,6 +232,7 @@
|
||||||
isAudioNotificationSupported: Settings.isAudioNotificationSupported(),
|
isAudioNotificationSupported: Settings.isAudioNotificationSupported(),
|
||||||
isHideMenuBarSupported: Settings.isHideMenuBarSupported(),
|
isHideMenuBarSupported: Settings.isHideMenuBarSupported(),
|
||||||
isDrawAttentionSupported: Settings.isDrawAttentionSupported(),
|
isDrawAttentionSupported: Settings.isDrawAttentionSupported(),
|
||||||
|
isAutoLaunchSupported: Settings.isAutoLaunchSupported(),
|
||||||
hasSystemTheme: true,
|
hasSystemTheme: true,
|
||||||
themeLight: i18n('themeLight'),
|
themeLight: i18n('themeLight'),
|
||||||
themeDark: i18n('themeDark'),
|
themeDark: i18n('themeDark'),
|
||||||
|
|
|
@ -118,10 +118,12 @@
|
||||||
{{ spellCheckDirtyText }}
|
{{ spellCheckDirtyText }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
{{ #isAutoLaunchSupported }}
|
||||||
<div class='auto-launch-setting'>
|
<div class='auto-launch-setting'>
|
||||||
<input type='checkbox' name='auto-launch-setting' id='auto-launch-setting' />
|
<input type='checkbox' name='auto-launch-setting' id='auto-launch-setting' />
|
||||||
<label for='auto-launch-setting'>{{ autoLaunchDescription }}</label>
|
<label for='auto-launch-setting'>{{ autoLaunchDescription }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
{{ /isAutoLaunchSupported }}
|
||||||
<hr>
|
<hr>
|
||||||
<div class='calling-setting'>
|
<div class='calling-setting'>
|
||||||
<h3>{{ calling }}</h3>
|
<h3>{{ calling }}</h3>
|
||||||
|
|
|
@ -102,6 +102,24 @@ describe('Settings', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('isAutoLaunchSupported', () => {
|
||||||
|
it('returns true on Windows', () => {
|
||||||
|
sandbox.stub(process, 'platform').value('win32');
|
||||||
|
sandbox.stub(os, 'release').returns('8.0.0');
|
||||||
|
assert.isTrue(Settings.isAutoLaunchSupported());
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns true on macOS', () => {
|
||||||
|
sandbox.stub(process, 'platform').value('darwin');
|
||||||
|
assert.isTrue(Settings.isAutoLaunchSupported());
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns false on Linux', () => {
|
||||||
|
sandbox.stub(process, 'platform').value('linux');
|
||||||
|
assert.isFalse(Settings.isAutoLaunchSupported());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('isHideMenuBarSupported', () => {
|
describe('isHideMenuBarSupported', () => {
|
||||||
it('returns false on macOS', () => {
|
it('returns false on macOS', () => {
|
||||||
sandbox.stub(process, 'platform').value('darwin');
|
sandbox.stub(process, 'platform').value('darwin');
|
||||||
|
|
|
@ -29,6 +29,12 @@ export const isAudioNotificationSupported = (): boolean =>
|
||||||
export const isNotificationGroupingSupported = (): boolean =>
|
export const isNotificationGroupingSupported = (): boolean =>
|
||||||
!OS.isWindows() || OS.isWindows(MIN_WINDOWS_VERSION);
|
!OS.isWindows() || OS.isWindows(MIN_WINDOWS_VERSION);
|
||||||
|
|
||||||
|
// Login item settings are only supported on macOS and Windows, according to [Electron's
|
||||||
|
// docs][0].
|
||||||
|
// [0]: https://www.electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows
|
||||||
|
export const isAutoLaunchSupported = (): boolean =>
|
||||||
|
OS.isWindows() || OS.isMacOS();
|
||||||
|
|
||||||
// the "hide menu bar" option is specific to Windows and Linux
|
// the "hide menu bar" option is specific to Windows and Linux
|
||||||
export const isHideMenuBarSupported = (): boolean => !OS.isMacOS();
|
export const isHideMenuBarSupported = (): boolean => !OS.isMacOS();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue