({
enabled = true,
}: { enabled?: boolean } = {})
| 99 | |
| 100 | /** The reader's notifications, as the notifications page pages them. */ |
| 101 | export const notificationsQueryOptions = ({ |
| 102 | enabled = true, |
| 103 | }: { enabled?: boolean } = {}) => |
| 104 | infiniteQueryOptions({ |
| 105 | queryKey: ['notifications'], |
| 106 | queryFn: ({ pageParam }) => |
| 107 | gqlClient.request<NotificationsData>(NOTIFICATIONS_QUERY, { |
| 108 | first: 100, |
| 109 | after: pageParam, |
| 110 | }), |
| 111 | initialPageParam: '', |
| 112 | getNextPageParam: ({ notifications }) => |
| 113 | getNextPageParam(notifications?.pageInfo), |
| 114 | enabled, |
| 115 | }); |
| 116 | |
| 117 | /** Push subscribers already got the squad subscription, so it is hidden. */ |
| 118 | export const isNotificationVisible = ( |
no test coverage detected