()
| 13 | }; |
| 14 | |
| 15 | export 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 | }; |
no test coverage detected