mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
refactor: streamline feature creation and auto-start logic in BoardView
- Removed the delay mechanism for starting newly created features, simplifying the process. - Updated the logic to capture existing feature IDs before adding a new feature, allowing for immediate identification of the newly created feature. - Enhanced error handling to notify users if the feature could not be started automatically.
This commit is contained in:
@@ -288,24 +288,20 @@ export function AddFeatureDialog({
|
||||
onOpenChange(false);
|
||||
};
|
||||
|
||||
const handleAdd = () => {
|
||||
const featureData = buildFeatureData();
|
||||
if (!featureData) return;
|
||||
|
||||
onAdd(featureData);
|
||||
resetForm();
|
||||
};
|
||||
|
||||
const handleAddAndStart = () => {
|
||||
if (!onAddAndStart) return;
|
||||
const handleAction = (actionFn?: (data: FeatureData) => void) => {
|
||||
if (!actionFn) return;
|
||||
|
||||
const featureData = buildFeatureData();
|
||||
if (!featureData) return;
|
||||
|
||||
onAddAndStart(featureData);
|
||||
actionFn(featureData);
|
||||
resetForm();
|
||||
};
|
||||
|
||||
const handleAdd = () => handleAction(onAdd);
|
||||
|
||||
const handleAddAndStart = () => handleAction(onAddAndStart);
|
||||
|
||||
const handleDialogClose = (open: boolean) => {
|
||||
onOpenChange(open);
|
||||
if (!open) {
|
||||
|
||||
Reference in New Issue
Block a user