Prevent unnecessary switch

pull/4649/head
Cagatay Civici 2023-10-18 00:59:30 +03:00
parent 92d2176ffd
commit 032a6a8355
1 changed files with 7 additions and 5 deletions

View File

@ -22,11 +22,13 @@ export default {
},
mounted() {
this.themeChangeListener = (event) => {
if (event.theme !== this.$appState.theme) {
this.$primevue.changeTheme(this.$appState.theme, event.theme, 'theme-link', () => {
this.$appState.theme = event.theme;
this.$appState.darkTheme = event.dark;
EventBus.emit('theme-change-complete', { theme: event.theme, dark: event.dark });
});
}
};
EventBus.on('theme-change', this.themeChangeListener);