diff --git a/src/main/core/ConfigManager.js b/src/main/core/ConfigManager.js index 3adab31..bb572af 100644 --- a/src/main/core/ConfigManager.js +++ b/src/main/core/ConfigManager.js @@ -31,8 +31,8 @@ export default class ConfigManager { } init () { - this.initSystemConfig() this.initUserConfig() + this.initSystemConfig() } /** @@ -140,13 +140,12 @@ export default class ConfigManager { fixSystemConfig () { // Remove aria2c unrecognized options const { others } = separateConfig(this.systemConfig.store) - if (!others) { - return + if (others && Object.keys(others).length > 0) { + Object.keys(others).forEach(key => { + this.systemConfig.delete(key) + }) } - Object.keys(others).forEach(key => { - this.systemConfig.delete(key) - }) // Fix spawn ENAMETOOLONG on Windows const tracker = reduceTrackerString(this.systemConfig.get('bt-tracker')) diff --git a/src/renderer/components/Preference/Advanced.vue b/src/renderer/components/Preference/Advanced.vue index 0d18545..8a27699 100644 --- a/src/renderer/components/Preference/Advanced.vue +++ b/src/renderer/components/Preference/Advanced.vue @@ -432,7 +432,7 @@ EMPTY_STRING, ENGINE_RPC_PORT, LOG_LEVELS, - trackerSourceOptions + TRACKER_SOURCE_OPTIONS, } from '@shared/constants' import { backupConfig, @@ -516,7 +516,7 @@ formOriginal, hideRpcSecret: true, rules: {}, - trackerSourceOptions, + trackerSourceOptions: TRACKER_SOURCE_OPTIONS, trackerSyncing: false } }, diff --git a/src/renderer/pages/index/App.vue b/src/renderer/pages/index/App.vue index da8a526..4511a10 100644 --- a/src/renderer/pages/index/App.vue +++ b/src/renderer/pages/index/App.vue @@ -78,13 +78,13 @@ this.updateRootClassName() }, watch: { - themeClass (val, oldVal) { + themeClass () { this.updateRootClassName() }, - i18nClass (val, oldVal) { + i18nClass () { this.updateRootClassName() }, - directionClass (val, oldVal) { + directionClass () { this.updateRootClassName() } } diff --git a/src/renderer/pages/index/commands.js b/src/renderer/pages/index/commands.js index 7d0457c..ade6802 100644 --- a/src/renderer/pages/index/commands.js +++ b/src/renderer/pages/index/commands.js @@ -22,7 +22,7 @@ const updateSystemTheme = (payload = {}) => { const updateTheme = (payload = {}) => { const { theme } = payload - store.dispatch('preference/updateThemeConfig', theme) + store.dispatch('preference/updateAppTheme', theme) } const updateTrayFocused = (payload = {}) => { diff --git a/src/renderer/store/modules/preference.js b/src/renderer/store/modules/preference.js index f7e39e3..b685192 100644 --- a/src/renderer/store/modules/preference.js +++ b/src/renderer/store/modules/preference.js @@ -114,7 +114,7 @@ const actions = { favoriteDirectories: favorite }) }, - updateThemeConfig ({ dispatch }, theme) { + updateAppTheme ({ dispatch }, theme) { dispatch('updatePreference', { theme }) }, updatePreference ({ commit }, config) { diff --git a/src/shared/constants.js b/src/shared/constants.js index eced3ff..ff1f402 100644 --- a/src/shared/constants.js +++ b/src/shared/constants.js @@ -89,7 +89,7 @@ export const XIU2_TRACKERS_HTTP_URL_CDN = 'https://fastly.jsdelivr.net/gh/XIU2/T // For bt-exclude-tracker export const XIU2_TRACKERS_BLACK_URL = 'https://fastly.jsdelivr.net/gh/XIU2/TrackersListCollection/blacklist.txt' -export const trackerSourceOptions = [ +export const TRACKER_SOURCE_OPTIONS = [ { label: 'ngosang/trackerslist', options: [