Skip to content

Commit

Permalink
修复sys_theme被覆盖问题
Browse files Browse the repository at this point in the history
问题复现步骤:
①在config/ColorUI.js配置config.theme为light,此时主题为light
②通过ui-change-theme把主题切换为dark,此时主题为dark
③刷新一下页面,storage的sys_theme被覆盖为light,$cuConfig.theme为dark
④再次刷新一下页面,storage的sys_theme为light,$cuConfig.theme为light
  • Loading branch information
qywk99 authored Mar 13, 2023
1 parent 0831d85 commit 08d51e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mp-cu/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ export default class ColorUI {
setStatusStyle(wx.getSystemInfoSync().theme === 'light' ? 'dark' : 'light')
})
} else {
wx.setStorageSync('sys_theme', this.config.theme)
setStatusStyle(this.config.theme === 'light' ? 'dark' : 'light');
wx.setStorageSync('sys_theme', store.state.sys_theme)
setStatusStyle(store.state.sys_theme === 'light' ? 'dark' : 'light');
}
const originPage = Page
const originComponent = Component;
Expand Down

0 comments on commit 08d51e5

Please sign in to comment.