feat(in-app-menu): enable in-app-menu by default (in Windows) (#1311)

This commit is contained in:
JellyBrick
2023-10-14 03:07:06 +09:00
committed by GitHub
parent bf9e3b5f48
commit a62cafb601
4 changed files with 27 additions and 5 deletions

View File

@ -118,7 +118,12 @@ const defaultConfig = {
playlistMaxItems: undefined as number | undefined,
},
'exponential-volume': {},
'in-app-menu': {},
'in-app-menu': {
/**
* true in Windows, false in Linux and macOS (see youtube-music/config/store.ts)
*/
enabled: false,
},
'last-fm': {
enabled: false,
token: undefined as string | undefined, // Token used for authentication

View File

@ -1,8 +1,16 @@
import Store from 'electron-store';
import Conf from 'conf';
import is from 'electron-is';
import defaults from './defaults';
const getDefaults = () => {
if (is.windows()) {
defaults.plugins['in-app-menu'].enabled = true;
}
return defaults;
};
const setDefaultPluginOptions = (store: Conf<Record<string, unknown>>, plugin: keyof typeof defaults.plugins) => {
if (!store.get(`plugins.${plugin}`)) {
store.set(`plugins.${plugin}`, defaults.plugins[plugin]);
@ -118,7 +126,7 @@ const migrations = {
};
export default new Store({
defaults,
defaults: getDefaults(),
clearInvalidConfig: false,
migrations,
});