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