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

Commit1697b42

Browse files
fix: restore original proxy auto-selection logic
Revert useEffect dependency arrays to match main branch behavior:- Remove userSavedProxy from dependency arrays- Call loadUserSelectedProxy() directly in auto-selection logic- This ensures auto-selection works when no user proxy is savedCo-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
1 parent15a7819 commit1697b42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎site/src/contexts/ProxyContext.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
156156
// biome-ignore lint/correctness/useExhaustiveDependencies: Only update if the source data changes
157157
useEffect(()=>{
158158
updateProxy();
159-
},[proxiesResp,proxyLatencies,userSavedProxy]);
159+
},[proxiesResp,proxyLatencies]);
160160

161161
// This useEffect will auto select the best proxy if the user has not selected one.
162162
// It must wait until all latencies are loaded to select based on latency. This does mean
@@ -165,7 +165,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
165165
// Once the page is loaded, or the user selects a proxy, this will not run again.
166166
// biome-ignore lint/correctness/useExhaustiveDependencies: Only update if the source data changes
167167
useEffect(()=>{
168-
if(userSavedProxy!==undefined){
168+
if(loadUserSelectedProxy()!==undefined){
169169
return;// User has selected a proxy, do not auto select.
170170
}
171171
if(!latenciesLoaded){
@@ -175,7 +175,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
175175

176176
constbest=getPreferredProxy(
177177
proxiesResp??[],
178-
userSavedProxy,
178+
loadUserSelectedProxy(),
179179
proxyLatencies,
180180
true,
181181
);
@@ -184,7 +184,7 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
184184
saveUserSelectedProxy(best.proxy);
185185
updateProxy();
186186
}
187-
},[latenciesLoaded,proxiesResp,proxyLatencies,userSavedProxy]);
187+
},[latenciesLoaded,proxiesResp,proxyLatencies]);
188188

189189
return(
190190
<ProxyContext.Provider

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp