MCPcopy Create free account
hub / github.com/bytebase/bytebase / useOptionalCurrentUser

Function useOptionalCurrentUser

frontend/src/react/hooks/useAppState.ts:27–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25export { isConnectAlreadyExists };
26
27export function useOptionalCurrentUser() {
28 const user = useAppStore((state) => state.currentUser);
29 const loadCurrentUser = useAppStore((state) => state.loadCurrentUser);
30 useEffect(() => {
31 void loadCurrentUser();
32 }, [loadCurrentUser]);
33 return user;
34}
35
36export function useCurrentUser() {
37 const user = useOptionalCurrentUser();

Callers 7

WatermarkFunction · 0.90
ProfileMenuTriggerFunction · 0.90
LandingPageFunction · 0.90
DangerZoneSectionFunction · 0.90
useCurrentUserFunction · 0.85
useRecentProjectsFunction · 0.85
useRecentVisitFunction · 0.85

Calls 1

useAppStoreFunction · 0.50

Tested by

no test coverage detected