mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 15:15:24 +00:00
fix(settings): leave user manage view when switching admin sections (#1649)
The admin panel stays mounted across Settings pages, so an open user manage view kept replacing every other admin section until Back to users was clicked. Reset it whenever the selected section changes.
This commit is contained in:
1 parent
694dc34b19
commit
bc74fba3f5
2 files changed
+119
No files matched your search
@@ -217,6 +217,12 @@ export function AdminSettingsPanel({
|
||||
setUserPage(0);
|
||||
}, [userSearch]);
|
||||
|
||||
// The panel stays mounted across Settings pages, so an open user view
|
||||
// would otherwise replace whichever section is picked next.
|
||||
useEffect(() => {
|
||||
setManageUser(null);
|
||||
}, [section]);
|
||||
|
||||
useEffect(() => {
|
||||
onEditingChange?.(manageUser !== null);
|
||||
return () => onEditingChange?.(false);
|
||||
|
||||
Reference in new issue
Block a user