File tree Expand file tree Collapse file tree 8 files changed +93
-142
lines changed
packages/@core/forward/preferences/src Expand file tree Collapse file tree 8 files changed +93
-142
lines changed Original file line number Diff line number Diff line change 3333 "rxjs" : " ^7.8.1"
3434 },
3535 "devDependencies" : {
36- "@nestjs/cli" : " ^10.4.0 " ,
36+ "@nestjs/cli" : " ^10.4.1 " ,
3737 "@nestjs/schematics" : " ^10.1.2" ,
3838 "@types/express" : " ^4.17.21" ,
3939 "@types/node" : " ^20.14.9" ,
Original file line number Diff line number Diff line change 1111 "license" : " MIT" ,
1212 "author" : {
1313 "name" : " vben" ,
14- "email" : " anncwb@126 .com" ,
14+ "email" : " ann.vben@gmail .com" ,
1515 "url" : " https://github.com/anncwb"
1616 },
1717 "type" : " module" ,
2929 "@vben-core/preferences" : " workspace:*" ,
3030 "@vben-core/request" : " workspace:*" ,
3131 "@vben-core/stores" : " workspace:*" ,
32+ "@vben/access" : " workspace:*" ,
3233 "@vben/chart-ui" : " workspace:*" ,
3334 "@vben/constants" : " workspace:*" ,
3435 "@vben/icons" : " workspace:*" ,
3536 "@vben/layouts" : " workspace:*" ,
3637 "@vben/locales" : " workspace:*" ,
37- "@vben/access" : " workspace:*" ,
3838 "@vben/styles" : " workspace:*" ,
3939 "@vben/types" : " workspace:*" ,
4040 "@vben/universal-ui" : " workspace:*" ,
Original file line number Diff line number Diff line change 3434 "dayjs" : " ^1.11.11" ,
3535 "find-up" : " ^7.0.0" ,
3636 "nanoid" : " ^5.0.7" ,
37- "pkg-types" : " ^1.1.2 " ,
37+ "pkg-types" : " ^1.1.3 " ,
3838 "prettier" : " ^3.3.2" ,
3939 "rimraf" : " ^5.0.7" ,
4040 "zx" : " ^7.2.3"
Original file line number Diff line number Diff line change 2020 ],
2121 "dependencies" : {
2222 "@vben/types" : " workspace:*" ,
23- "vite" : " ^5.3.2 "
23+ "vite" : " ^5.3.3 "
2424 }
2525}
Original file line number Diff line number Diff line change 4747 "rollup-plugin-visualizer" : " ^5.12.0" ,
4848 "sass" : " ^1.77.6" ,
4949 "unplugin-turbo-console" : " ^1.8.9" ,
50- "vite" : " ^5.3.2 " ,
50+ "vite" : " ^5.3.3 " ,
5151 "vite-plugin-compression" : " ^0.5.1" ,
5252 "vite-plugin-dts" : " ^3.9.1" ,
5353 "vite-plugin-html" : " ^3.2.2"
Original file line number Diff line number Diff line change 1818 "license" : " MIT" ,
1919 "author" : {
2020 "name" : " vben" ,
21- "email" : " anncwb@126 .com" ,
21+ "email" : " ann.vben@gmail .com" ,
2222 "url" : " https://github.com/anncwb"
2323 },
2424 "type" : " module" ,
6868 "is-ci" : " ^3.0.1" ,
6969 "jsdom" : " ^24.1.0" ,
7070 "rimraf" : " ^5.0.7" ,
71- "taze" : " ^0.14.1 " ,
71+ "taze" : " ^0.14.2 " ,
7272 "turbo" : " ^2.0.6" ,
7373 "typescript" : " ^5.5.3" ,
7474 "unbuild" : " ^2.0.0" ,
75- "vite" : " ^5.3.2 " ,
75+ "vite" : " ^5.3.3 " ,
7676 "vitest" : " ^2.0.0-beta.12" ,
7777 "vue-tsc" : " ^2.0.24"
7878 },
Original file line number Diff line number Diff line change @@ -161,14 +161,15 @@ class PreferenceManager {
161161 private updateColorMode ( preference : Preferences ) {
162162 if ( preference . app ) {
163163 const { colorGrayMode, colorWeakMode } = preference . app ;
164+ const dom = document . documentElement ;
164165 const COLOR_WEAK = 'invert-mode' ;
165166 const COLOR_GRAY = 'grayscale-mode' ;
166167 colorWeakMode
167- ? document . documentElement . classList . add ( COLOR_WEAK )
168- : document . documentElement . classList . remove ( COLOR_WEAK ) ;
168+ ? dom . classList . add ( COLOR_WEAK )
169+ : dom . classList . remove ( COLOR_WEAK ) ;
169170 colorGrayMode
170- ? document . documentElement . classList . add ( COLOR_GRAY )
171- : document . documentElement . classList . remove ( COLOR_GRAY ) ;
171+ ? dom . classList . add ( COLOR_GRAY )
172+ : dom . classList . remove ( COLOR_GRAY ) ;
172173 }
173174 }
174175
@@ -346,7 +347,7 @@ class PreferenceManager {
346347 * 更新偏好设置
347348 * @param updates - 要更新的偏好设置
348349 */
349- public async updatePreferences ( updates : DeepPartial < Preferences > ) {
350+ public updatePreferences ( updates : DeepPartial < Preferences > ) {
350351 const mergedState = merge ( { } , updates , markRaw ( this . state ) ) ;
351352
352353 Object . assign ( this . state , mergedState ) ;
You can’t perform that action at this time.
0 commit comments