Prevent unnecessary switch
parent
92d2176ffd
commit
032a6a8355
12
app.vue
12
app.vue
|
@ -22,11 +22,13 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.themeChangeListener = (event) => {
|
this.themeChangeListener = (event) => {
|
||||||
this.$primevue.changeTheme(this.$appState.theme, event.theme, 'theme-link', () => {
|
if (event.theme !== this.$appState.theme) {
|
||||||
this.$appState.theme = event.theme;
|
this.$primevue.changeTheme(this.$appState.theme, event.theme, 'theme-link', () => {
|
||||||
this.$appState.darkTheme = event.dark;
|
this.$appState.theme = event.theme;
|
||||||
EventBus.emit('theme-change-complete', { theme: event.theme, dark: event.dark });
|
this.$appState.darkTheme = event.dark;
|
||||||
});
|
EventBus.emit('theme-change-complete', { theme: event.theme, dark: event.dark });
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
EventBus.on('theme-change', this.themeChangeListener);
|
EventBus.on('theme-change', this.themeChangeListener);
|
||||||
|
|
Loading…
Reference in New Issue