chore: add function to refetch latencies to ProxyContext (#7769)

* Allow refetching of proxy latencies
* Pass refetch funtion up the context stack
* Add to menu bar
This commit is contained in:
Steven Masley
2023-06-01 13:37:20 +00:00
committed by GitHub
parent cf8d2bc096
commit b32ed2d97e
11 changed files with 52 additions and 12 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ jest.mock("contexts/useProxyLatency", () => ({
useProxyLatency: (proxies?: RegionsResponse) => {
// Must use `useMemo` here to avoid infinite loop.
// Mocking the hook with a hook.
const latencies = useMemo(() => {
const proxyLatencies = useMemo(() => {
if (!proxies) {
return {} as Record<string, ProxyLatencyReport>
}
@@ -35,7 +35,7 @@ jest.mock("contexts/useProxyLatency", () => ({
}, {} as Record<string, ProxyLatencyReport>)
}, [proxies])
return latencies
return { proxyLatencies, refetch: jest.fn() }
},
}))