切换主题bugfix

This commit is contained in:
xiaoqi.cxq 2022-08-07 11:23:57 +08:00
parent 73ead46873
commit 19d3a16034

View File

@ -247,7 +247,7 @@ export default {
const themeStr = `colorTheme: ${colorTheme}`; const themeStr = `colorTheme: ${colorTheme}`;
let settingsStr = (customSettingStr && customSettingStr.trim()) || '# 增加您的自定义配置覆盖默认配置'; let settingsStr = (customSettingStr && customSettingStr.trim()) || '# 增加您的自定义配置覆盖默认配置';
settingsStr = settingsStr.indexOf('colorTheme:') > -1 ? settingsStr = settingsStr.indexOf('colorTheme:') > -1 ?
settingsStr.replace(/colorTheme:.*/, themeStr) : `${settingsStr}\n${themeStr}`; settingsStr.replace(/.*colorTheme:.*/, themeStr) : `${settingsStr}\n${themeStr}`;
commit('setItem', itemTemplate('settings', settingsStr)); commit('setItem', itemTemplate('settings', settingsStr));
badgeSvc.addBadge('switchTheme'); badgeSvc.addBadge('switchTheme');
}, },