mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 23:13:02 +01:00
Initialize issue form when selection changes
cgen-70e22962a71c49c081a7ab132259706a
This commit is contained in:
parent
cf07b2e57f
commit
2207d2eb33
1 changed files with 14 additions and 1 deletions
|
|
@ -41,9 +41,22 @@ export function SwitchPage() {
|
||||||
setCurrentBranchIdState(cur);
|
setCurrentBranchIdState(cur);
|
||||||
await refreshHistory(activeRepo.id, cur);
|
await refreshHistory(activeRepo.id, cur);
|
||||||
}
|
}
|
||||||
setIssues(await listIssues(activeRepo.id));
|
const iss = await listIssues(activeRepo.id);
|
||||||
|
setIssues(iss);
|
||||||
|
if (iss.length) selectIssue(iss[0].id);
|
||||||
})(); }, [activeRepo?.id]);
|
})(); }, [activeRepo?.id]);
|
||||||
|
|
||||||
|
function selectIssue(id: string) {
|
||||||
|
setSelectedIssueId(id);
|
||||||
|
const it = issues.find(i=>i.id===id);
|
||||||
|
if (it) {
|
||||||
|
setIssueTitle(it.title);
|
||||||
|
setIssueBody(it.body);
|
||||||
|
setIssueLabels(it.labels.join(", "));
|
||||||
|
setIssueStatus(it.status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function refreshRepos() {
|
async function refreshRepos() {
|
||||||
const list = await listRepositories();
|
const list = await listRepositories();
|
||||||
setRepos(list);
|
setRepos(list);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue