Fixes an issue regarding self-set-present

This commit is contained in:
Sean 2020-04-20 19:17:03 +02:00
parent d210496146
commit 91d4b3c7af
1 changed files with 3 additions and 3 deletions

View File

@ -428,10 +428,10 @@ export class UserListComponent extends BaseListViewComponent<ViewUser> implement
public setPresent(viewUser: ViewUser): void {
viewUser.user.is_present = !viewUser.user.is_present;
if (this.operator.viewUser === viewUser) {
this.operator.setPresence(viewUser.user.is_present).catch(this.raiseError);
} else {
if (this.operator.hasPerms('users.can_manage')) {
this.repo.update(viewUser.user, viewUser).catch(this.raiseError);
} else if (this.allowSelfSetPresent && this.operator.viewUser === viewUser) {
this.operator.setPresence(viewUser.user.is_present).catch(this.raiseError);
}
}
}