mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
Add ability to save/restore queue (#111)
* add ability to save/restore play queue * Add restoreQueue action * Add optional pause param on setQueue --------- Co-authored-by: jeffvli <jeffvictorli@gmail.com>
This commit is contained in:
parent
c1c6ce33e4
commit
106fc90c4a
10 changed files with 180 additions and 7 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import isElectron from 'is-electron';
|
||||
import { Group } from '@mantine/core';
|
||||
import { Select, Tooltip, NumberInput, Switch, Slider } from '/@/renderer/components';
|
||||
import { SettingsSection } from '/@/renderer/features/settings/components/settings-section';
|
||||
|
|
@ -8,6 +9,8 @@ import {
|
|||
} from '/@/renderer/store/settings.store';
|
||||
import { Play } from '/@/renderer/types';
|
||||
|
||||
const localSettings = isElectron() ? window.electron.localSettings : null;
|
||||
|
||||
const SIDE_QUEUE_OPTIONS = [
|
||||
{ label: 'Fixed', value: 'sideQueue' },
|
||||
{ label: 'Floating', value: 'sideDrawerQueue' },
|
||||
|
|
@ -170,6 +173,25 @@ export const ControlSettings = () => {
|
|||
isHidden: false,
|
||||
title: 'Volume wheel step',
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
defaultChecked={settings.resume}
|
||||
onChange={(e) => {
|
||||
localSettings?.set('resume', e.target.checked);
|
||||
setSettings({
|
||||
general: {
|
||||
...settings,
|
||||
resume: e.currentTarget.checked,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
),
|
||||
description: 'When exiting, save the current play queue and restore it when reopening',
|
||||
isHidden: !isElectron(),
|
||||
title: 'Save play queue',
|
||||
},
|
||||
];
|
||||
|
||||
return <SettingsSection options={controlOptions} />;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue