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

Commit8c2b457

Browse files
fix: remove unused import and fix proxy auto-selection race condition
- Remove unused useMutation import to fix lint error- Fix updateProxy to use loadUserSelectedProxy() directly instead of stale userSavedProxy variable- This ensures updateProxy always uses current localStorage value after auto-selectionCo-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>
1 parent1697b42 commit8c2b457

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎site/src/contexts/ProxyContext.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
useMemo,
1414
useState,
1515
}from"react";
16-
import{useMutation,useQuery,useQueryClient}from"react-query";
16+
import{useQuery,useQueryClient}from"react-query";
1717

1818
import{typeProxyLatencyReport,useProxyLatency}from"./useProxyLatency";
1919

@@ -141,15 +141,15 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
141141
setProxy(
142142
getPreferredProxy(
143143
proxiesResp??[],
144-
userSavedProxy,
144+
loadUserSelectedProxy(),
145145
proxyLatencies,
146146
// Do not auto select based on latencies, as inconsistent latencies can cause this
147147
// to change on each call. updateProxy should be stable when selecting a proxy to
148148
// prevent flickering.
149149
false,
150150
),
151151
);
152-
},[proxiesResp,proxyLatencies,userSavedProxy]);
152+
},[proxiesResp,proxyLatencies]);
153153

154154
// This useEffect ensures the proxy to be used is updated whenever the state changes.
155155
// This includes proxies being loaded, latencies being calculated, and the user selecting a proxy.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp