Skip to content

fix: admin role toggle showing incorrect state after update#633

Merged
LukeGus merged 1 commit intoTermix-SSH:dev-2.1.0from
ZacharyZcR:fix/admin-role-toggle-display
Mar 29, 2026
Merged

fix: admin role toggle showing incorrect state after update#633
LukeGus merged 1 commit intoTermix-SSH:dev-2.1.0from
ZacharyZcR:fix/admin-role-toggle-display

Conversation

@ZacharyZcR
Copy link
Copy Markdown
Member

@ZacharyZcR ZacharyZcR commented Mar 26, 2026

Summary

  • Fixed the administrator role switch always appearing as "off" in the User Edit dialog, even after successfully granting admin privileges
  • Root cause: after toggling admin status, onSuccess() closed the dialog and cleared the user reference, but onOpenChange(true) then reopened the dialog with a null user, preventing isAdmin state from syncing correctly
  • Removed the redundant dialog reopen — onSuccess() now handles cleanup normally

Related Issues

Closes Termix-SSH/Support#549
Closes Termix-SSH/Support#605

Test plan

  • Open Admin Settings → Users → edit a non-admin user (including OIDC users)
  • Toggle Administrator Role on → confirm in the toast
  • Reopen the same user's edit dialog — switch should now show as enabled
  • Toggle Administrator Role off → confirm — switch should update correctly

After successfully toggling admin status, onSuccess() closes the dialog
and clears the user reference, but onOpenChange(true) then reopens the
dialog with null user, causing isAdmin state to not sync properly.

Removed the redundant dialog reopen after success - let onSuccess
handle the cleanup normally.

Closes Termix-SSH/Support#549
@LukeGus LukeGus changed the base branch from main to dev-2.1.0 March 29, 2026 05:18
@LukeGus LukeGus merged commit a670720 into Termix-SSH:dev-2.1.0 Mar 29, 2026
1 check failed
@ZacharyZcR ZacharyZcR deleted the fix/admin-role-toggle-display branch March 29, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] User with Administrator Role enabled shows switch off

2 participants