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

Function useHostStatus

packages/shared/src/hooks/useHostPermissionStatus.ts:15–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13};
14
15export const useHostStatus = (): UseHostStatus => {
16 const { getHostPermission } = useExtensionContext();
17
18 const {
19 data: hostGranted,
20 isFetched,
21 refetch,
22 isFetching,
23 } = useQuery({
24 queryKey: hostKey,
25 queryFn: async () => {
26 if (typeof getHostPermission === 'function') {
27 return await getHostPermission();
28 }
29
30 return false;
31 },
32 ...disabledRefetch,
33 });
34
35 return { hostGranted: hostGranted ?? false, isFetched, isFetching, refetch };
36};

Callers 3

BootDataProviderFunction · 0.90
InternalAppFunction · 0.90

Calls 2

useExtensionContextFunction · 0.90
getHostPermissionFunction · 0.85

Tested by

no test coverage detected