@@ -22,7 +22,7 @@ interface ProxyContextValue {
22
22
}
23
23
24
24
interface PreferredProxy {
25
- // selectedProxy is the region the user has selected.
25
+ // selectedProxy is the proxy the user has selected.
26
26
// Do not use the fields 'path_app_url' or 'wildcard_hostname' from this
27
27
// object. Use the preferred fields.
28
28
selectedProxy : Region | undefined
@@ -44,7 +44,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
44
44
let savedProxy = loadPreferredProxy ( )
45
45
if ( ! savedProxy ) {
46
46
// 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.
48
48
// This is the same as a user not selecting any proxy.
49
49
savedProxy = getPreferredProxy ( [ ] )
50
50
}
@@ -59,7 +59,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
59
59
queryKey,
60
60
queryFn : getWorkspaceProxies ,
61
61
// 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,
63
63
// then the user selection is removed.
64
64
onSuccess : ( ) => {
65
65
setAndSaveProxy ( proxy . selectedProxy )
@@ -71,7 +71,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
71
71
selectedProxy ?: Region ,
72
72
) => {
73
73
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?" )
75
75
}
76
76
const preferred = getPreferredProxy ( proxies . regions , selectedProxy )
77
77
// Save to local storage to persist the user's preference across reloads
@@ -126,7 +126,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
126
126
// ******************************* //
127
127
128
128
// TODO: @emyrk Should make an api call to /regions endpoint to update the
129
- // regions list.
129
+ // proxies list.
130
130
131
131
return (
132
132
< ProxyContext . Provider
@@ -136,7 +136,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
136
136
isLoading : proxiesLoading ,
137
137
isFetched : proxiesFetched ,
138
138
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
140
140
// the state with the appropriate urls.
141
141
setProxy : setAndSaveProxy ,
142
142
} }
@@ -161,8 +161,8 @@ export const useProxy = (): ProxyContextValue => {
161
161
* assumed no proxy is configured and relative paths should be used.
162
162
* Exported for testing.
163
163
*
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.
166
166
*/
167
167
export const getPreferredProxy = (
168
168
proxies : Region [ ] ,
0 commit comments