Fix FamilyProvider redirect for admin pages

Skip family check when pathname starts with /admin
to prevent redirect to onboarding

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Manohar Gupta 2026-05-17 11:01:37 +05:30
parent d94a15e38e
commit 70376d2e96

View file

@ -49,6 +49,12 @@ export function FamilyProvider({ children: providerChildren }: { children: React
const [memberCount, setMemberCount] = useState(2); const [memberCount, setMemberCount] = useState(2);
useEffect(() => { useEffect(() => {
// Skip family check for admin pages
if (typeof window !== "undefined" && window.location.pathname.startsWith("/admin")) {
setLoading(false);
return;
}
async function fetchFamilyData() { async function fetchFamilyData() {
try { try {
// Get current session from database // Get current session from database