mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 12:22:14 +03:00
The proxy assignments list returned by /api/settings/proxies/assignments is global, so its first entry belongs to some other scope. ProxyConfigModal picked `items.find(matchingScope) || items[0]`, so opening the proxy config for a freshly created provider/key (which has no assignment of its own) fell back to items[0] and pre-filled host/port/user/password from an unrelated proxy plus set hasOwnProxy=true — users reported a new provider already carried a proxy they never configured. Extracted the scope helpers into proxyAssignment.ts and added selectScopeAssignment which returns null (never items[0]) when the current scope has no assignment. The modal then shows the empty/custom state for new scopes. Both call sites now use it. TDD: src/shared/components/proxyAssignment.test.tsx (no-match -> null red->green for provider/key/global scopes; matching-scope + empty-list regression guards). Existing ProxyConfigModal component test stays green.