Skip to content

Commit

Permalink
Implement better notification handling on lang switch
Browse files Browse the repository at this point in the history
  • Loading branch information
gordlin committed Nov 14, 2024
1 parent 860bbe4 commit 65d5a05
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,14 @@ export class InstanceAPI {
return;
}
const configStore = useConfigStore(this.$vApp.$pinia);
const notificationStore = useNotificationStore(this.$vApp.$pinia);
const langs = configStore.registeredLangs;

// If monoconfig, clear all notifications (notification language isn't changed on lang change)
if (Object.keys(configStore.registeredConfigs).length === 1) {
notificationStore.clearAll();
}

const old = this.$i18n.locale.value;
this.$i18n.locale.value = language;

Expand Down

0 comments on commit 65d5a05

Please sign in to comment.