mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 21:03:08 +00:00
Merge main into feat/rework-keybinds-and-setting-page - resolved conflicts in settings-view.tsx
This commit is contained in:
@@ -373,7 +373,9 @@ export interface AppActions {
|
||||
// Feature actions
|
||||
setFeatures: (features: Feature[]) => void;
|
||||
updateFeature: (id: string, updates: Partial<Feature>) => void;
|
||||
addFeature: (feature: Omit<Feature, "id">) => void;
|
||||
addFeature: (
|
||||
feature: Omit<Feature, "id"> & Partial<Pick<Feature, "id">>
|
||||
) => Feature;
|
||||
removeFeature: (id: string) => void;
|
||||
moveFeature: (id: string, newStatus: Feature["status"]) => void;
|
||||
|
||||
@@ -805,10 +807,12 @@ export const useAppStore = create<AppState & AppActions>()(
|
||||
},
|
||||
|
||||
addFeature: (feature) => {
|
||||
const id = `feature-${Date.now()}-${Math.random()
|
||||
.toString(36)
|
||||
.substr(2, 9)}`;
|
||||
set({ features: [...get().features, { ...feature, id }] });
|
||||
const id =
|
||||
feature.id ||
|
||||
`feature-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
||||
const featureWithId = { ...feature, id } as Feature;
|
||||
set({ features: [...get().features, featureWithId] });
|
||||
return featureWithId;
|
||||
},
|
||||
|
||||
removeFeature: (id) => {
|
||||
|
||||
Reference in New Issue
Block a user