Fixes an issue regarding self-set-present
This commit is contained in:
parent
d210496146
commit
91d4b3c7af
@ -428,10 +428,10 @@ export class UserListComponent extends BaseListViewComponent<ViewUser> implement
|
|||||||
public setPresent(viewUser: ViewUser): void {
|
public setPresent(viewUser: ViewUser): void {
|
||||||
viewUser.user.is_present = !viewUser.user.is_present;
|
viewUser.user.is_present = !viewUser.user.is_present;
|
||||||
|
|
||||||
if (this.operator.viewUser === viewUser) {
|
if (this.operator.hasPerms('users.can_manage')) {
|
||||||
this.operator.setPresence(viewUser.user.is_present).catch(this.raiseError);
|
|
||||||
} else {
|
|
||||||
this.repo.update(viewUser.user, viewUser).catch(this.raiseError);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user