Skip to content

Commit ebfaec5

Browse files
committed
refactor: clean up ProxyContext code
1 parent 7004c9c commit ebfaec5

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

site/src/contexts/ProxyContext.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
118118
});
119119

120120
const { permissions } = useAuthenticated();
121-
const query = async (): Promise<readonly Region[]> => {
121+
const queryFn = async (): Promise<readonly Region[]> => {
122122
const endpoint = permissions.editWorkspaceProxies
123123
? getWorkspaceProxies
124124
: getWorkspaceProxyRegions;
@@ -131,13 +131,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
131131
error: proxiesError,
132132
isLoading: proxiesLoading,
133133
isFetched: proxiesFetched,
134-
} = useQuery(
135-
cachedQuery({
136-
initialData,
137-
queryKey,
138-
queryFn: query,
139-
}),
140-
);
134+
} = useQuery(cachedQuery({ initialData, queryKey, queryFn }));
141135

142136
// Every time we get a new proxiesResponse, update the latency check
143137
// to each workspace proxy.

0 commit comments

Comments
 (0)