Implement onboarding completion UX: refresh profile, correct achievement name, hide prompts, add success toast and badge
cgen-3ee432f0eeb24eeca50fb3ba495a8bc5
This commit is contained in:
parent
d7f0eeec71
commit
073a7d7c7e
1 changed files with 6 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ interface AuthContextType {
|
||||||
signInWithOAuth: (provider: "github" | "google") => Promise<void>;
|
signInWithOAuth: (provider: "github" | "google") => Promise<void>;
|
||||||
signOut: () => Promise<void>;
|
signOut: () => Promise<void>;
|
||||||
updateProfile: (updates: Partial<AethexUserProfile>) => Promise<void>;
|
updateProfile: (updates: Partial<AethexUserProfile>) => Promise<void>;
|
||||||
|
refreshProfile: () => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AuthContext = createContext<AuthContextType | undefined>(undefined);
|
const AuthContext = createContext<AuthContextType | undefined>(undefined);
|
||||||
|
|
@ -259,6 +260,10 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const refreshProfile = async () => {
|
||||||
|
if (user?.id) await fetchUserProfile(user.id);
|
||||||
|
};
|
||||||
|
|
||||||
const value = {
|
const value = {
|
||||||
user,
|
user,
|
||||||
profile,
|
profile,
|
||||||
|
|
@ -271,6 +276,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||||
signInWithOAuth,
|
signInWithOAuth,
|
||||||
signOut,
|
signOut,
|
||||||
updateProfile,
|
updateProfile,
|
||||||
|
refreshProfile,
|
||||||
};
|
};
|
||||||
|
|
||||||
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
|
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue