mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
refactor(editor): put editor theme behind local storage flag (#4498)
set theme
This commit is contained in:
parent
3a1fa09108
commit
3c9ad02ce3
|
@ -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();
|
||||
|
|
|
@ -249,6 +249,7 @@ export const LOCAL_STORAGE_PIN_DATA_DISCOVERY_NDV_FLAG = 'N8N_PIN_DATA_DISCOVERY
|
|||
export const LOCAL_STORAGE_PIN_DATA_DISCOVERY_CANVAS_FLAG = 'N8N_PIN_DATA_DISCOVERY_CANVAS';
|
||||
export const LOCAL_STORAGE_MAPPING_FLAG = 'N8N_MAPPING_ONBOARDED';
|
||||
export const LOCAL_STORAGE_MAIN_PANEL_RELATIVE_WIDTH = 'N8N_MAIN_PANEL_RELATIVE_WIDTH';
|
||||
export const LOCAL_STORAGE_THEME = 'N8N_THEME';
|
||||
export const BASE_NODE_SURVEY_URL = 'https://n8n-community.typeform.com/to/BvmzxqYv#nodename=';
|
||||
|
||||
export const HIRING_BANNER = `
|
||||
|
|
Loading…
Reference in a new issue