Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1e4e116

Browse files
revert: restore original working ProxyContext fromc70efd8
Revert to the original working version to test if the issue is withmy changes or if there was a different underlying problem.Co-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
1 parent7ef638f commit1e4e116

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

‎site/src/contexts/ProxyContext.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,20 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
115115
},
116116
});
117117

118-
// Load the initial state from localStorage first
118+
// Get user saved proxy from API or fallback to localStorage for migration
119+
constuserSavedProxy=useMemo(()=>{
120+
if(userProxyQuery.data?.preferred_proxy){
121+
// Find the proxy object from the preferred_proxy ID
122+
constproxyId=userProxyQuery.data.preferred_proxy;
123+
returnproxiesResp?.find((p)=>p.id===proxyId);
124+
}
125+
// Fallback to localStorage for migration
126+
returnloadUserSelectedProxy();
127+
},[userProxyQuery.data,proxiesResp]);
128+
129+
// Load the initial state from user preferences or localStorage.
119130
const[proxy,setProxy]=useState<PreferredProxy>(
120-
computeUsableURLS(loadUserSelectedProxy()),
131+
computeUsableURLS(userSavedProxy),
121132
);
122133

123134
const{ permissions}=useAuthenticated();
@@ -143,17 +154,6 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
143154
}),
144155
);
145156

146-
// Get user saved proxy from API or fallback to localStorage for migration
147-
constuserSavedProxy=useMemo(()=>{
148-
if(userProxyQuery.data?.preferred_proxy){
149-
// Find the proxy object from the preferred_proxy ID
150-
constproxyId=userProxyQuery.data.preferred_proxy;
151-
returnproxiesResp?.find((p)=>p.id===proxyId);
152-
}
153-
// Fallback to localStorage for migration
154-
returnloadUserSelectedProxy();
155-
},[userProxyQuery.data,proxiesResp]);
156-
157157
// Every time we get a new proxiesResponse, update the latency check
158158
// to each workspace proxy.
159159
const{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp