Merge remote dev and resolve conflicts in CreateSessionForm
This commit is contained in:
@@ -73,23 +73,19 @@ export const CreateSessionForm = ({
|
||||
|
||||
// Load branches when selected repo changes
|
||||
useEffect(() => {
|
||||
if (!selectedRepo || !showCloneMode) {
|
||||
const projectId = fixedProjectId || selectedProject;
|
||||
if (!selectedRepo || !projectId || !showCloneMode) {
|
||||
setBranches([]);
|
||||
return;
|
||||
}
|
||||
const loadBranches = async () => {
|
||||
setIsLoadingBranches(true);
|
||||
try {
|
||||
const branchResponse = await listRepositoryBranches(
|
||||
fixedProjectId || selectedProject,
|
||||
selectedRepo
|
||||
);
|
||||
const branchList = branchResponse.branches;
|
||||
setBranches(branchList);
|
||||
const defaultBranch = branchList.find((b) => b.is_default);
|
||||
if (defaultBranch) {
|
||||
setBranch(defaultBranch.name);
|
||||
setBaseBranch(defaultBranch.name);
|
||||
const response = await listRepositoryBranches(projectId, selectedRepo);
|
||||
setBranches(response.branches);
|
||||
if (response.default_branch) {
|
||||
setBranch(response.default_branch);
|
||||
setBaseBranch(response.default_branch);
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
@@ -98,7 +94,7 @@ export const CreateSessionForm = ({
|
||||
}
|
||||
};
|
||||
void loadBranches();
|
||||
}, [selectedRepo, showCloneMode, selectedProject, fixedProjectId]);
|
||||
}, [selectedRepo, selectedProject, fixedProjectId, showCloneMode]);
|
||||
|
||||
// Filter repositories by selected project
|
||||
const availableRepos = selectedProject
|
||||
|
||||
Reference in New Issue
Block a user