mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
+2
-2
@@ -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() }
|
||||
},
|
||||
}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user