fix(media): resolve 400 Bad Request on next/image proxy, add auto scroll to top on route change, disable swagger in prod, and fix dev ports
This commit is contained in:
1 parent
2d54fc8208
commit
c7d7ac3aa3
22 files changed
+9862
-9779
No files matched your search
@@ -57,27 +57,10 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
|
||||
}
|
||||
}, [fetchProfile, fetchSettings]);
|
||||
|
||||
// Handle scroll position tracking per pathname for reliable mobile back navigation
|
||||
// Scroll to top on navigation / pathname change
|
||||
useEffect(() => {
|
||||
if (typeof window === 'undefined') return;
|
||||
|
||||
const key = `scroll_pos_${pathname}`;
|
||||
const savedPos = sessionStorage.getItem(key);
|
||||
if (savedPos !== null) {
|
||||
const targetY = parseInt(savedPos, 10);
|
||||
requestAnimationFrame(() => {
|
||||
window.scrollTo({ top: targetY, behavior: 'instant' });
|
||||
});
|
||||
}
|
||||
|
||||
const handleScroll = () => {
|
||||
sessionStorage.setItem(`scroll_pos_${pathname}`, window.scrollY.toString());
|
||||
};
|
||||
|
||||
window.addEventListener('scroll', handleScroll, { passive: true });
|
||||
return () => {
|
||||
window.removeEventListener('scroll', handleScroll);
|
||||
};
|
||||
window.scrollTo({ top: 0, left: 0, behavior: 'instant' });
|
||||
}, [pathname]);
|
||||
|
||||
// Check Maintenance Mode (Admin / Partner bypass)
|
||||
|
||||
Reference in new issue
Block a user