Consider onboarding_complete flag when exposing profileComplete
cgen-ce39d5ea04a946e797ff76a0e31ca431
This commit is contained in:
parent
5b880d5be3
commit
d0e94523ad
1 changed files with 6 additions and 1 deletions
|
|
@ -264,13 +264,18 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||||
if (user?.id) await fetchUserProfile(user.id);
|
if (user?.id) await fetchUserProfile(user.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const computedComplete =
|
||||||
|
checkProfileComplete(profile) ||
|
||||||
|
(typeof window !== "undefined" &&
|
||||||
|
window.localStorage.getItem("onboarding_complete") === "1");
|
||||||
|
|
||||||
const value = {
|
const value = {
|
||||||
user,
|
user,
|
||||||
profile,
|
profile,
|
||||||
roles,
|
roles,
|
||||||
session,
|
session,
|
||||||
loading,
|
loading,
|
||||||
profileComplete: checkProfileComplete(profile),
|
profileComplete: computedComplete,
|
||||||
signIn,
|
signIn,
|
||||||
signUp,
|
signUp,
|
||||||
signInWithOAuth,
|
signInWithOAuth,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue