mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 02:43:33 +00:00
add setting to prevent sleep on playback (#1072)
This commit is contained in:
parent
40fb5ba916
commit
b00305cc86
7 changed files with 114 additions and 0 deletions
|
|
@ -203,6 +203,34 @@ export const WindowSettings = () => {
|
|||
isHidden: !isElectron() || !settings.tray,
|
||||
title: t('setting.startMinimized', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label="Toggle prevent sleep on playback"
|
||||
defaultChecked={settings.preventSleepOnPlayback}
|
||||
disabled={!isElectron()}
|
||||
onChange={(e) => {
|
||||
if (!e) return;
|
||||
localSettings?.set(
|
||||
'window_prevent_sleep_on_playback',
|
||||
e.currentTarget.checked,
|
||||
);
|
||||
setSettings({
|
||||
window: {
|
||||
...settings,
|
||||
preventSleepOnPlayback: e.currentTarget.checked,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
),
|
||||
description: t('setting.preventSleepOnPlayback', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.preventSleepOnPlayback', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
];
|
||||
|
||||
return <SettingsSection options={windowOptions} />;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue