Refactor on dynamic changes

This commit is contained in:
mertsincan 2024-03-12 09:46:43 +00:00
parent 31e56ea73a
commit 75b5f494d3
2 changed files with 14 additions and 4 deletions

View file

@ -5,6 +5,7 @@ const ServiceSymbol = Symbol();
export default {
_pConfig: undefined,
_colorScheme: 'dark',
_initializeColorScheme: false,
getPConfig() {
return this._pConfig;
},
@ -21,6 +22,12 @@ export default {
setColorScheme(newValue) {
this._colorScheme = newValue;
},
isColorSchemeInit() {
return this._initializeColorScheme;
},
setColorSchemeInit(newValue) {
this._initializeColorScheme = newValue;
},
toggleColorScheme() {
this._colorScheme = this._colorScheme === 'dark' ? 'light' : 'dark';
const defaultDocument = SharedUtils.dom.isClient() ? window.document : undefined;