Implement resetStates hook and integrate it into Header component for state management
This commit is contained in:
@@ -8,6 +8,7 @@ interface AisleStore {
|
||||
updateAisle: (uuid: string, updated: Partial<Aisle>) => void;
|
||||
removeAisle: (uuid: string) => void;
|
||||
removePoint: (uuid: string) => Aisles;
|
||||
clearAisles: () => void;
|
||||
setPosition: (
|
||||
pointUuid: string,
|
||||
position: [number, number, number]
|
||||
@@ -92,6 +93,12 @@ export const createAisleStore = () => {
|
||||
return removedAisles;
|
||||
},
|
||||
|
||||
clearAisles: () => {
|
||||
set((state) => {
|
||||
state.aisles = [];
|
||||
})
|
||||
},
|
||||
|
||||
setPosition: (pointUuid, position) => {
|
||||
let updatedAisle: Aisle | undefined;
|
||||
set((state) => {
|
||||
|
||||
Reference in New Issue
Block a user