|
2 | 2 | createSignal, |
3 | 3 | createEffect, |
4 | 4 | createMemo, |
| 5 | + untrack, |
5 | 6 | Show, |
6 | 7 | Index, |
7 | 8 | For, |
@@ -141,27 +142,29 @@ export default function RepoSelector(props: RepoSelectorProps) { |
141 | 142 | await Promise.allSettled(promises); |
142 | 143 | } |
143 | 144 |
|
144 | | - // After all org repos have loaded, trigger upstream discovery if enabled |
| 145 | + // After all org repos have loaded, trigger upstream discovery if enabled. |
| 146 | + // Use untrack to prevent reactive prop reads from re-triggering the effect. |
145 | 147 | if (props.showUpstreamDiscovery && version === effectVersion) { |
146 | | - const currentUser = user(); |
| 148 | + const currentUser = untrack(() => user()); |
147 | 149 | const discoveryClient = getClient(); |
148 | 150 | if (currentUser && discoveryClient) { |
149 | 151 | setDiscoveringUpstream(true); |
150 | 152 | setDiscoveredRepos([]); |
151 | 153 | setDiscoveryCapped(false); |
152 | | - // Build exclude set from all org repos + already-selected repos + current upstream repos |
153 | 154 | const allOrgFullNames = new Set<string>(); |
154 | 155 | for (const state of orgStates()) { |
155 | 156 | for (const repo of state.repos) { |
156 | 157 | allOrgFullNames.add(repo.fullName); |
157 | 158 | } |
158 | 159 | } |
159 | | - for (const repo of props.selected) { |
160 | | - allOrgFullNames.add(repo.fullName); |
161 | | - } |
162 | | - for (const repo of props.upstreamRepos ?? []) { |
163 | | - allOrgFullNames.add(repo.fullName); |
164 | | - } |
| 160 | + untrack(() => { |
| 161 | + for (const repo of props.selected) { |
| 162 | + allOrgFullNames.add(repo.fullName); |
| 163 | + } |
| 164 | + for (const repo of props.upstreamRepos ?? []) { |
| 165 | + allOrgFullNames.add(repo.fullName); |
| 166 | + } |
| 167 | + }); |
165 | 168 | void discoverUpstreamRepos(discoveryClient, currentUser.login, allOrgFullNames) |
166 | 169 | .then((repos) => { |
167 | 170 | if (version !== effectVersion) return; |
|
0 commit comments