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() { function closeUserCard() {
usersStore.closeUser({ skipPush: true }); usersStore.closeUser({ skipPush: true });
if (active === "users" || active === "payments") { if (active === "users" || active === "payments") {
onSectionChange(active); onSectionChange(active, 0);
} }
} }
+6 -4
View File
@@ -120,9 +120,11 @@ export function syncSectionPath(
if (normalized === "admin") { if (normalized === "admin") {
const adm = const adm =
adminSection || adminSectionFromPath(window.location.pathname, routePrefix) || "stats"; adminSection || adminSectionFromPath(window.location.pathname, routePrefix) || "stats";
const uid = const clearAdminUser = adminUserId === 0 || adminUserId === false;
adminUserId ?? const uid = clearAdminUser
(adm === "users" ? adminUserIdFromPath(window.location.pathname, routePrefix) : null); ? null
: (adminUserId ??
(adm === "users" ? adminUserIdFromPath(window.location.pathname, routePrefix) : null));
const supportTicketId = const supportTicketId =
adm === "support" adm === "support"
? adminSupportTicketIdFromPath(window.location.pathname, routePrefix) ? adminSupportTicketIdFromPath(window.location.pathname, routePrefix)
@@ -130,7 +132,7 @@ export function syncSectionPath(
const paymentId = const paymentId =
adm === "payments" ? adminPaymentIdFromPath(window.location.pathname, routePrefix) : null; adm === "payments" ? adminPaymentIdFromPath(window.location.pathname, routePrefix) : null;
const paymentUserId = const paymentUserId =
adm === "payments" adm === "payments" && !clearAdminUser
? adminPaymentsUserIdFromPath(window.location.pathname, routePrefix) ? adminPaymentsUserIdFromPath(window.location.pathname, routePrefix)
: null; : null;
if (adm === "users" && uid) targetPath = `/admin/users/${uid}`; if (adm === "users" && uid) targetPath = `/admin/users/${uid}`;