fix(mobile): improve scroll restoration, media gesture swipe, 5-digit otp, persistent cooldown and modal android back navigation
Deploy Canina / deploy (push) Successful in 2m6s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 0s

This commit is contained in:
parsa aghaei committed 2026-09-05 17:53:29 +03:30
1 parent 00cfd1a2a0
commit 1d2d141514
16 files changed
+12610 -11527

No files matched your search

+20 -2
View File
@@ -58,10 +58,28 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
}
}, [fetchProfile, fetchSettings]);
// Scroll to top on navigation / pathname change
// Track navigation type (push vs pop) to allow smooth scroll restoration on Back/Forward
useEffect(() => {
if (typeof window === 'undefined') return;
window.scrollTo({ top: 0, left: 0, behavior: 'instant' });
let popstateTriggered = false;
const handlePopState = () => {
popstateTriggered = true;
};
window.addEventListener('popstate', handlePopState);
// Give microtask/frame for popstate event to register before checking
const timeoutId = setTimeout(() => {
if (!popstateTriggered) {
window.scrollTo({ top: 0, left: 0, behavior: 'instant' });
}
}, 0);
return () => {
window.removeEventListener('popstate', handlePopState);
clearTimeout(timeoutId);
};
}, [pathname]);
// Check Maintenance Mode (Admin / Partner bypass)