[admin] when impersonating, allow removing account without admin getting logged out

This commit is contained in:
Andrea Vos 2022-08-15 18:02:45 +02:00
parent 600ed48f8a
commit 50a55cc380
2 changed files with 7 additions and 2 deletions

View File

@ -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});

View File

@ -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,