From 2145bc5cee3a72c2baa33c1001c09ec3af4948a2 Mon Sep 17 00:00:00 2001 From: squiddy Date: Mon, 27 May 2024 01:03:41 +0800 Subject: [PATCH] test4 --- frontend/src/components/viewer/RoleViewer.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/viewer/RoleViewer.vue b/frontend/src/components/viewer/RoleViewer.vue index 4ae745e..c594af6 100644 --- a/frontend/src/components/viewer/RoleViewer.vue +++ b/frontend/src/components/viewer/RoleViewer.vue @@ -164,12 +164,14 @@ export default class RoleViewer extends Vue { action: this.usersPopup.action, emails: this.emailsWithRoles }) - }).then(() => EventBus.$emit('needRoleUpdate', () => { - console.log(this); - console.log('debug', this.editedRole.rid); - this.$router.push({name: 'Role', params: {rid: this.editedRole.rid}}); - this.saving = false; - })).catch(err => { + }).then(() => { + const rid = this.editedRole.rid; + EventBus.$emit('needRoleUpdate', () => { + // this.editedRole is reset in this callback + this.$router.push({name: 'Role', params: {rid: rid}}); + this.saving = false; + }); + }).catch(err => { this.saving = false; alert(err); }); else {