fix(admin): clear user route on modal close

This commit is contained in:
BADtochka
2026-06-06 20:16:43 +03:00
parent ae3d6a9b99
commit fcb8e51ec0
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -425,7 +425,7 @@
function closeUserCard() {
usersStore.closeUser({ skipPush: true });
if (active === "users" || active === "payments") {
onSectionChange(active);
onSectionChange(active, 0);
}
}
+6 -4
View File
@@ -120,9 +120,11 @@ export function syncSectionPath(
if (normalized === "admin") {
const adm =
adminSection || adminSectionFromPath(window.location.pathname, routePrefix) || "stats";
const uid =
adminUserId ??
(adm === "users" ? adminUserIdFromPath(window.location.pathname, routePrefix) : null);
const clearAdminUser = adminUserId === 0 || adminUserId === false;
const uid = clearAdminUser
? null
: (adminUserId ??
(adm === "users" ? adminUserIdFromPath(window.location.pathname, routePrefix) : null));
const supportTicketId =
adm === "support"
? adminSupportTicketIdFromPath(window.location.pathname, routePrefix)
@@ -130,7 +132,7 @@ export function syncSectionPath(
const paymentId =
adm === "payments" ? adminPaymentIdFromPath(window.location.pathname, routePrefix) : null;
const paymentUserId =
adm === "payments"
adm === "payments" && !clearAdminUser
? adminPaymentsUserIdFromPath(window.location.pathname, routePrefix)
: null;
if (adm === "users" && uid) targetPath = `/admin/users/${uid}`;