update assetID
This commit is contained in:
@@ -197,10 +197,10 @@ export const useMenuVisible = create<any>((set: any) => ({
|
||||
setMenuVisible: (x: any) => set(() => ({ menuVisible: x })),
|
||||
}));
|
||||
|
||||
export const useDeleteTool = create<any>((set: any) => ({
|
||||
deleteTool: false,
|
||||
setDeleteTool: (x: any) => set(() => ({ deleteTool: x })),
|
||||
}));
|
||||
// export const useDeleteTool = create<any>((set: any) => ({
|
||||
// deleteTool: false,
|
||||
// setDeleteTool: (x: any) => set(() => ({ deleteTool: x })),
|
||||
// }));
|
||||
|
||||
export const useToolMode = create<any>((set: any) => ({
|
||||
toolMode: null,
|
||||
@@ -222,10 +222,10 @@ export const useMovePoint = create<any>((set: any) => ({
|
||||
setMovePoint: (x: any) => set(() => ({ movePoint: x })),
|
||||
}));
|
||||
|
||||
export const useDeletePointOrLine = create<any>((set: any) => ({
|
||||
deletePointOrLine: false,
|
||||
setDeletePointOrLine: (x: any) => set(() => ({ deletePointOrLine: x })),
|
||||
}));
|
||||
// export const useDeletePointOrLine = create<any>((set: any) => ({
|
||||
// deletePointOrLine: false,
|
||||
// setDeletePointOrLine: (x: any) => set(() => ({ deletePointOrLine: x })),
|
||||
// }));
|
||||
|
||||
export const useWallItems = create<any>((set: any) => ({
|
||||
wallItems: [],
|
||||
@@ -631,6 +631,7 @@ export const useCompareStore = create<CompareStore>((set) => ({
|
||||
toggleComparePopUp: () =>
|
||||
set((state) => ({ comparePopUp: !state.comparePopUp })),
|
||||
}));
|
||||
|
||||
// Save state store
|
||||
interface SaveVersionStore {
|
||||
isVersionSaved: boolean;
|
||||
|
||||
@@ -7,6 +7,7 @@ type EventsStore = {
|
||||
// Event-level actions
|
||||
addEvent: (event: EventsSchema) => void;
|
||||
removeEvent: (modelUuid: string) => void;
|
||||
clearEvents: () => void;
|
||||
updateEvent: (modelUuid: string, updates: Partial<EventsSchema>) => EventsSchema | undefined;
|
||||
|
||||
// Point-level actions
|
||||
@@ -61,6 +62,12 @@ export const useEventsStore = create<EventsStore>()(
|
||||
});
|
||||
},
|
||||
|
||||
clearEvents: () => {
|
||||
set((state) => {
|
||||
state.events = [];
|
||||
});
|
||||
},
|
||||
|
||||
updateEvent: (modelUuid, updates) => {
|
||||
let updatedEvent: EventsSchema | undefined;
|
||||
set((state) => {
|
||||
|
||||
@@ -7,6 +7,7 @@ type ProductsStore = {
|
||||
// Product-level actions
|
||||
addProduct: (productName: string, productUuid: string) => void;
|
||||
setProducts: (products: productsSchema) => void;
|
||||
clearProducts: () => void;
|
||||
removeProduct: (productUuid: string) => void;
|
||||
updateProduct: (productUuid: string, updates: Partial<{ productName: string; eventDatas: EventsSchema[] }>) => void;
|
||||
|
||||
@@ -99,6 +100,12 @@ export const useProductStore = create<ProductsStore>()(
|
||||
});
|
||||
},
|
||||
|
||||
clearProducts: () => {
|
||||
set((state) => {
|
||||
state.products = [];
|
||||
});
|
||||
},
|
||||
|
||||
removeProduct: (productUuid) => {
|
||||
set((state) => {
|
||||
state.products = state.products.filter(p => p.productUuid !== productUuid);
|
||||
|
||||
Reference in New Issue
Block a user