Skip to content

Commit eb6493c

Browse files
committed
Renames regions -> proxies
1 parent edbe6e4 commit eb6493c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

site/src/contexts/ProxyContext.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface ProxyContextValue {
2222
}
2323

2424
interface PreferredProxy {
25-
// selectedProxy is the region the user has selected.
25+
// selectedProxy is the proxy the user has selected.
2626
// Do not use the fields 'path_app_url' or 'wildcard_hostname' from this
2727
// object. Use the preferred fields.
2828
selectedProxy: Region | undefined
@@ -44,7 +44,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
4444
let savedProxy = loadPreferredProxy()
4545
if (!savedProxy) {
4646
// If no preferred proxy is saved, then default to using relative paths
47-
// and no subdomain support until the regions are properly loaded.
47+
// and no subdomain support until the proxies are properly loaded.
4848
// This is the same as a user not selecting any proxy.
4949
savedProxy = getPreferredProxy([])
5050
}
@@ -59,7 +59,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
5959
queryKey,
6060
queryFn: getWorkspaceProxies,
6161
// This onSuccess ensures the local storage is synchronized with the
62-
// regions returned by coderd. If the selected region is not in the list,
62+
// proxies returned by coderd. If the selected proxy is not in the list,
6363
// then the user selection is removed.
6464
onSuccess: () => {
6565
setAndSaveProxy(proxy.selectedProxy)
@@ -71,7 +71,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
7171
selectedProxy?: Region,
7272
) => {
7373
if (!proxies) {
74-
throw new Error("proxies are not yet loaded, so selecting a region makes no sense. How did you get here?")
74+
throw new Error("proxies are not yet loaded, so selecting a proxy makes no sense. How did you get here?")
7575
}
7676
const preferred = getPreferredProxy(proxies.regions, selectedProxy)
7777
// Save to local storage to persist the user's preference across reloads
@@ -126,7 +126,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
126126
// ******************************* //
127127

128128
// TODO: @emyrk Should make an api call to /regions endpoint to update the
129-
// regions list.
129+
// proxies list.
130130

131131
return (
132132
<ProxyContext.Provider
@@ -136,7 +136,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
136136
isLoading: proxiesLoading,
137137
isFetched: proxiesFetched,
138138
error: proxiesError,
139-
// A function that takes the new regions and selected region and updates
139+
// A function that takes the new proxies and selected proxy and updates
140140
// the state with the appropriate urls.
141141
setProxy: setAndSaveProxy,
142142
}}
@@ -161,8 +161,8 @@ export const useProxy = (): ProxyContextValue => {
161161
* assumed no proxy is configured and relative paths should be used.
162162
* Exported for testing.
163163
*
164-
* @param proxies Is the list of regions returned by coderd. If this is empty, default behavior is used.
165-
* @param selectedProxy Is the region the user has selected. If this is undefined, default behavior is used.
164+
* @param proxies Is the list of proxies returned by coderd. If this is empty, default behavior is used.
165+
* @param selectedProxy Is the proxy the user has selected. If this is undefined, default behavior is used.
166166
*/
167167
export const getPreferredProxy = (
168168
proxies: Region[],

0 commit comments

Comments
 (0)