(queryClient: QueryClient)
| 85 | // refreshes as the lit tab refreshes it, any other page refetches what is on |
| 86 | // screen. |
| 87 | export const refreshPage = async (queryClient: QueryClient): Promise<void> => { |
| 88 | const hasFeed = |
| 89 | queryClient |
| 90 | .getQueryCache() |
| 91 | .findAll({ type: 'active', predicate: isRootFeed }).length > 0; |
| 92 | |
| 93 | if (hasFeed) { |
| 94 | await refreshShell(queryClient, { indicator: false }); |
| 95 | return; |
| 96 | } |
| 97 | |
| 98 | await bounded( |
| 99 | queryClient.refetchQueries({ type: 'active' }, { throwOnError: false }), |
| 100 | ); |
| 101 | }; |
| 102 | |
| 103 | export const useShellRefreshing = (): boolean => |
| 104 | useSyncExternalStore( |
no test coverage detected