kcm/users: refine "deleting logged-in user" UX
Reason for the change
Right now there are two problems:
- Deleting a logged-in user shows no warning about this.
- Asking to delete the files of a logged-in user fails silently (AccountsService simply won't do it).
This commit solves both problems: now the user sees a warning dialog when they try to delete another logged-in user, and it also prevents them from trying to delete a logged-in user's files, instead redirecting them to just delete the account but not the files.
To achieve this, I needed to change what the loggedIn
property does,
because previously it was inaccurate, returning whether the queried user
is the currently logged-in user. Now it returns whether the quaried user
is logged in, and I added a new isMe
property to hold whether the
queried user is the currently logged-in user.
Test plan
- Create a new user account.
- Log into it.
- Without logging out of it, switch back to your main user account.
- Use this KCM to try to delete the new user account using either file deletion option.
Then do it again, omitting steps 2 and 3.
Screenshots or screen recordings
Deleting logged-in account | Deleting logged-in account and attempting to delete files as well |
---|---|
![]() |
![]() |
Bugs fixed
BUG: 495494
FIXED-IN: 6.4.0