MCPcopy
hub / github.com/usememos/memos / useNotifications

Function useNotifications

web/src/hooks/useUserQueries.ts:83–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81}
82
83export function useNotifications() {
84 const currentUser = useCurrentUser();
85
86 return useQuery({
87 queryKey: userKeys.notifications(),
88 queryFn: async () => {
89 if (!currentUser?.name) {
90 return [];
91 }
92 const { notifications } = await userServiceClient.listUserNotifications({ parent: currentUser.name });
93 return notifications;
94 },
95 enabled: !!currentUser?.name,
96 staleTime: 1000 * 30, // 30 seconds - notifications should update frequently
97 });
98}
99
100export function useTagCounts(forCurrentUser = false) {
101 const currentUser = useCurrentUser();

Callers 2

NavigationFunction · 0.90
InboxesFunction · 0.90

Calls 1

useCurrentUserFunction · 0.85

Tested by

no test coverage detected