mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
Fix resumeOnStart option
This commit is contained in:
@ -14,7 +14,7 @@ const defaultConfig = {
|
||||
restartOnConfigChanges: false,
|
||||
trayClickPlayPause: false,
|
||||
autoResetAppCache: false,
|
||||
resumeSongOnStart: true
|
||||
resumeOnStart: true,
|
||||
},
|
||||
plugins: {
|
||||
// Enabled plugins
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
const defaultConfig = require("./defaults");
|
||||
const plugins = require("./plugins");
|
||||
const store = require("./store");
|
||||
|
||||
@ -10,6 +11,7 @@ const get = (key) => {
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
defaultConfig,
|
||||
get,
|
||||
set,
|
||||
edit: () => store.openInEditor(),
|
||||
|
||||
@ -3,6 +3,11 @@ const Store = require("electron-store");
|
||||
const defaults = require("./defaults");
|
||||
|
||||
const migrations = {
|
||||
">=1.11.0": (store) => {
|
||||
if (store.get("options.resumeOnStart") === undefined) {
|
||||
store.set("options.resumeOnStart", true);
|
||||
}
|
||||
},
|
||||
">=1.7.0": (store) => {
|
||||
const enabledPlugins = store.get("plugins");
|
||||
if (!Array.isArray(enabledPlugins)) {
|
||||
|
||||
4
index.js
4
index.js
@ -111,7 +111,9 @@ function createMainWindow() {
|
||||
win.maximize();
|
||||
}
|
||||
|
||||
const urlToLoad = config.get("resumeOnStart") ? config.get("url") : "https://music.youtube.com";
|
||||
const urlToLoad = config.get("options.resumeOnStart")
|
||||
? config.get("url")
|
||||
: config.defaultConfig.url;
|
||||
win.webContents.loadURL(urlToLoad);
|
||||
win.on("closed", onClosed);
|
||||
|
||||
|
||||
6
menu.js
6
menu.js
@ -69,10 +69,10 @@ const mainMenuTemplate = (win) => [
|
||||
{
|
||||
label: "Resume last song when app starts",
|
||||
type: "checkbox",
|
||||
checked: config.get("options.resumeSongOnStart"),
|
||||
checked: config.get("options.resumeOnStart"),
|
||||
click: (item) => {
|
||||
config.set("options.resumeSongOnStart", item.checked);
|
||||
}
|
||||
config.set("options.resumeOnStart", item.checked);
|
||||
},
|
||||
},
|
||||
...(is.windows() || is.linux()
|
||||
? [
|
||||
|
||||
Reference in New Issue
Block a user