feat(disable-autoplay): add apply once, resolve #9

This commit is contained in:
JellyBrick
2023-10-02 19:08:17 +09:00
parent 61b04e9b42
commit 042083b112
3 changed files with 34 additions and 6 deletions

View File

@ -0,0 +1,20 @@
import { BrowserWindow } from 'electron';
import { setMenuOptions } from '../../config/plugins';
import { MenuTemplate } from '../../menu';
import type { ConfigType } from '../../config/dynamic';
export default (_: BrowserWindow, options: ConfigType<'disable-autoplay'>): MenuTemplate => [
{
label: 'Applies only on startup',
type: 'checkbox',
checked: options.applyOnce,
click() {
setMenuOptions('disable-autoplay', {
applyOnce: !options.applyOnce,
});
}
}
];