feat(user): sync entitlement snapshot
This commit is contained in:
@@ -25,10 +25,10 @@ import type { UserState as MachineContext, UserEvent } from "./user-machine";
|
||||
*/
|
||||
interface UserState {
|
||||
currentUser: MachineContext["currentUser"];
|
||||
pronouns: string;
|
||||
coinBalance: number;
|
||||
isLoading: boolean;
|
||||
avatarUrl: string | null;
|
||||
isVip: boolean;
|
||||
creditBalance: number;
|
||||
}
|
||||
|
||||
const UserStateCtx = createContext<UserState | null>(null);
|
||||
@@ -45,14 +45,14 @@ export function UserProvider({ children }: UserProviderProps) {
|
||||
const userState = useMemo<UserState>(
|
||||
() => ({
|
||||
currentUser: state.context.currentUser,
|
||||
pronouns: state.context.pronouns,
|
||||
coinBalance: state.context.coinBalance,
|
||||
isLoading:
|
||||
state.matches("initializing") ||
|
||||
state.matches("fetching") ||
|
||||
state.matches("loggingOut") ||
|
||||
state.context.isLoading,
|
||||
avatarUrl: state.context.avatarUrl,
|
||||
isVip: state.context.isVip,
|
||||
creditBalance: state.context.creditBalance,
|
||||
}),
|
||||
[state],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user