fix: Address code review comments

This commit is contained in:
gsxdsm
2026-02-17 23:04:42 -08:00
parent 43c19c70ca
commit dd4c738e91
43 changed files with 1128 additions and 359 deletions

View File

@@ -69,6 +69,12 @@ export function SelectRemoteDialog({
url: r.url,
}));
setRemotes(remoteInfos);
setSelectedRemote((prev) => {
if (prev && remoteInfos.some((r) => r.name === prev)) {
return prev;
}
return remoteInfos.find((r) => r.name === 'origin')?.name ?? remoteInfos[0]?.name ?? '';
});
} else {
setError(result.error || 'Failed to fetch remotes');
}
@@ -120,6 +126,12 @@ export function SelectRemoteDialog({
url: r.url,
}));
setRemotes(remoteInfos);
setSelectedRemote((prev) => {
if (prev && remoteInfos.some((r) => r.name === prev)) {
return prev;
}
return remoteInfos.find((r) => r.name === 'origin')?.name ?? remoteInfos[0]?.name ?? '';
});
} else {
setError(result.error || 'Failed to refresh remotes');
}