mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-02 04:27:39 +00:00
fix(git-panel): handle promise rejection in branch creation and return success status
This commit is contained in:
@@ -24,16 +24,22 @@ export default function NewBranchModal({
|
||||
}
|
||||
}, [isOpen]);
|
||||
|
||||
const handleCreateBranch = async () => {
|
||||
const handleCreateBranch = async (): Promise<boolean> => {
|
||||
const branchName = newBranchName.trim();
|
||||
if (!branchName) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
const success = await onCreateBranch(branchName);
|
||||
if (success) {
|
||||
setNewBranchName('');
|
||||
onClose();
|
||||
try {
|
||||
const success = await onCreateBranch(branchName);
|
||||
if (success) {
|
||||
setNewBranchName('');
|
||||
onClose();
|
||||
}
|
||||
return success;
|
||||
} catch (error) {
|
||||
console.error('Failed to create branch:', error);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user