refactor(editor): put editor theme behind local storage flag (#4498)

set theme
This commit is contained in:
Mutasem Aldmour
2022-11-02 11:37:09 +01:00
committed by GitHub
parent 3a1fa09108
commit 3c9ad02ce3
2 changed files with 9 additions and 1 deletions

View File

@@ -30,7 +30,7 @@
import Modals from './components/Modals.vue';
import LoadingView from './views/LoadingView.vue';
import Telemetry from './components/Telemetry.vue';
import { HIRING_BANNER, VIEWS } from './constants';
import { HIRING_BANNER, LOCAL_STORAGE_THEME, VIEWS } from './constants';
import mixins from 'vue-typed-mixins';
import { showMessage } from './components/mixins/showMessage';
@@ -159,8 +159,15 @@ export default mixins(
this.$router.replace(redirect);
}
},
setTheme() {
const theme = window.localStorage.getItem(LOCAL_STORAGE_THEME);
if (theme) {
window.document.body.classList.add(`theme-${theme}`);
}
},
},
async mounted() {
this.setTheme();
await this.initialize();
this.logHiringBanner();
this.authenticate();