From 50a55cc38034efc1dd056b53d2a85462b33105ae Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Mon, 15 Aug 2022 18:02:45 +0200 Subject: [PATCH] [admin] when impersonating, allow removing account without admin getting logged out --- components/Account.vue | 7 ++++++- routes/admin.vue | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/Account.vue b/components/Account.vue index 7114752f0..a1355dfa5 100644 --- a/components/Account.vue +++ b/components/Account.vue @@ -325,7 +325,12 @@ await this.$confirm(this.$t('user.deleteAccountConfirm'), 'danger'); const response = await this.$post(`/user/delete`); - this.logout(); + + if (this.impersonationActive) { + this.stopImpersonation(); + } else { + this.logout(); + } }, async setAvatar(source) { const response = await this.$post(`/user/set-avatar`, {source}); diff --git a/routes/admin.vue b/routes/admin.vue index 70a4d3418..d08fbac3b 100644 --- a/routes/admin.vue +++ b/routes/admin.vue @@ -294,7 +294,7 @@ import {deepSet, head} from "../src/helpers"; localeFilter: true, adminsFilter: false, usersShown: false, - adminNotifications: this.$user().adminNotifications ?? 7, + adminNotifications: this.$user() ? (this.$user().adminNotifications ?? 7) : 7, translator, missingTranslations: translator.listMissingTranslations(), abuseReports: undefined,