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

Commit5fbc42d

Browse files
fix: improve latency-based proxy selection logic
Allow latency-based selection when no user proxy is saved, regardlessof whether latencies are loaded yet. Pass undefined latencies when notloaded to let getPreferredProxy handle the fallback logic properly.Co-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
1 parent2cba5ea commit5fbc42d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎site/src/contexts/ProxyContext.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,14 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
165165
// updateProxy is a helper function that when called will
166166
// update the proxy being used.
167167
constupdateProxy=useCallback(()=>{
168-
// Use latency-based selection if no user proxy is saved and latencies are loaded
169-
constshouldUseLatency=!userSavedProxy&&latenciesLoaded;
168+
// Use latency-based selection if no user proxy is saved
169+
// Only skip latency selection if we have a saved proxy or latencies aren't loaded yet
170+
constshouldUseLatency=!userSavedProxy;
170171
setProxy(
171172
getPreferredProxy(
172173
proxiesResp??[],
173174
userSavedProxy,
174-
proxyLatencies,
175+
latenciesLoaded ?proxyLatencies :undefined,
175176
shouldUseLatency,
176177
),
177178
);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp