MCPcopy Create free account
hub / github.com/dailydotdev/apps / refreshPage

Function refreshPage

packages/shared/src/components/shell/shellRefresh.ts:87–101  ·  view source on GitHub ↗
(queryClient: QueryClient)

Source from the content-addressed store, hash-verified

85// refreshes as the lit tab refreshes it, any other page refetches what is on
86// screen.
87export 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
103export const useShellRefreshing = (): boolean =>
104 useSyncExternalStore(

Callers 1

useNativeBridgeFunction · 0.90

Calls 2

refreshShellFunction · 0.85
boundedFunction · 0.85

Tested by

no test coverage detected