diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..2f3cb81cc --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,23 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "dev-runner (Electron)", + "type": "node", + "request": "launch", + "program": "${workspaceFolder}/_scripts/dev-runner.js", + "args": ["--remote-debug"] + }, + { + "name": "Attach to renderer process (Electron)", + "type": "chrome", + "request": "attach", + "port": 9223, + "webRoot": "http://localhost:9080", + "sourceMapPathOverrides": { + "webpack://freetube/./~/*": "${workspaceFolder}/node_modules/*", + "webpack://freetube/./*": "${workspaceFolder}/*" + } + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 3c0971b85..000000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "dev", - "problemMatcher": [] - }, - { - "type": "npm", - "script": "dev-runner", - "problemMatcher": [], - "label": "npm: dev-runner", - "detail": "node _scripts/dev-runner.js" - } - ] -} diff --git a/src/main/index.js b/src/main/index.js index 85b3a61c1..4acf06eb9 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -472,8 +472,12 @@ function runApp() { searchQueryText = null } = { }) { // Syncing new window background to theme choice. - const windowBackground = await baseHandlers.settings._findTheme().then(({ value }) => { - switch (value) { + const windowBackground = await baseHandlers.settings._findTheme().then((setting) => { + if (!setting) { + return nativeTheme.shouldUseDarkColors ? '#212121' : '#f1f1f1' + } + + switch (setting.value) { case 'dark': return '#212121' case 'light':