avatar to main merge

I have completed the character creation screen on the avatar branch and am preparing to merge it into main.
This commit is contained in:
pricewowen
2026-05-23 23:24:36 -06:00
parent 8957ecb81d
commit 61f98866e8
39 changed files with 2361 additions and 436 deletions

View File

@@ -3,6 +3,8 @@
import { useEffect, useState } from "react";
import { AppNav } from "@/components/layout/app-nav";
import { HABIT_PET_DATA_UPDATED_EVENT } from "@/lib/app-events";
import { getOnboardingStatusClient } from "@/lib/onboarding-status";
import { createClient } from "@/lib/supabase/client";
export function GlobalBottomNav() {
@@ -16,9 +18,13 @@ export function GlobalBottomNav() {
data: { user },
} = await supabase.auth.getUser();
setShowNav(
!!user && user.user_metadata?.onboarding_completed === true,
);
if (!user) {
setShowNav(false);
return;
}
const status = await getOnboardingStatusClient();
setShowNav(status?.appComplete === true);
}
void syncNavState();
@@ -29,7 +35,12 @@ export function GlobalBottomNav() {
void syncNavState();
});
return () => subscription.unsubscribe();
window.addEventListener(HABIT_PET_DATA_UPDATED_EVENT, syncNavState);
return () => {
subscription.unsubscribe();
window.removeEventListener(HABIT_PET_DATA_UPDATED_EVENT, syncNavState);
};
}, []);
if (!showNav) {