Update widgets and added settings
This commit is contained in:
@@ -43,6 +43,17 @@ export const useDashboardStore = create((set, get) => ({
|
||||
}
|
||||
},
|
||||
|
||||
updateWidgetSettings: (id, newSettings) => set((state) => {
|
||||
console.log("2. Zustand updating widget:", id, "with:", newSettings);
|
||||
return {
|
||||
widgets: state.widgets.map(widget =>
|
||||
widget.id === id
|
||||
? { ...widget, settings: { ...widget.settings, ...newSettings } }
|
||||
: widget
|
||||
)
|
||||
};
|
||||
}),
|
||||
|
||||
addWidget: (widgetId, sizeKey) => {
|
||||
const registryEntry = WIDGET_REGISTRY[widgetId];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user