fix(admin): clear user route on modal close
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user