File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import {
2828 setError ,
2929 setIsAuthError ,
3030} from "../features/Errors/errorsSlice" ;
31- import { updateConfig } from "../features/Config/configSlice" ;
31+ import { setThemeMode , updateConfig } from "../features/Config/configSlice" ;
3232import { resetAttachedImagesSlice } from "../features/AttachedImages" ;
3333import { nextTip } from "../features/TipOfTheDay" ;
3434import { telemetryApi } from "../services/refact/telemetry" ;
@@ -521,3 +521,18 @@ startListening({
521521 }
522522 } ,
523523} ) ;
524+
525+ startListening ( {
526+ matcher : isAnyOf ( updateConfig . match , setThemeMode . match ) ,
527+ effect : ( _action , listenerApi ) => {
528+ const appearance = listenerApi . getState ( ) . config . themeProps . appearance ;
529+ if ( appearance === "light" && document . body . className !== "vscode-light" ) {
530+ document . body . className = "vscode-light" ;
531+ } else if (
532+ appearance === "dark" &&
533+ document . body . className !== "vscode-dark"
534+ ) {
535+ document . body . className = "vscode-dark" ;
536+ }
537+ } ,
538+ } ) ;
You can’t perform that action at this time.
0 commit comments