fix(editor): Handling router errors when navigation is canceled by user (#5271)

* 🔨 Handling router errors in main sidebar, removing unused code
* 🔨 Handling router errors in modals
This commit is contained in:
Milorad FIlipović
2023-01-30 09:32:04 +01:00
committed by GitHub
parent 731ce96621
commit 911d656f99
2 changed files with 19 additions and 63 deletions

View File

@@ -155,6 +155,7 @@ import { useWorkflowsEEStore } from '@/stores/workflows.ee';
import { ITelemetryTrackProperties } from 'n8n-workflow';
import { useUsageStore } from '@/stores/usage';
import { BaseTextKey } from '@/plugins/i18n';
import { isNavigationFailure } from 'vue-router';
export default mixins(showMessage).extend({
name: 'workflow-share-modal',
@@ -427,7 +428,11 @@ export default mixins(showMessage).extend({
await this.usersStore.fetchUsers();
},
goToUsersSettings() {
this.$router.push({ name: VIEWS.USERS_SETTINGS });
this.$router.push({ name: VIEWS.USERS_SETTINGS }).catch((failure) => {
if (!isNavigationFailure(failure)) {
console.error(failure);
}
});
this.modalBus.$emit('close');
},
trackTelemetry(data: ITelemetryTrackProperties) {