diff --git a/app/src/components/compose/CanvasToolbar.tsx b/app/src/components/compose/CanvasToolbar.tsx index 53a9684..03f24b6 100644 --- a/app/src/components/compose/CanvasToolbar.tsx +++ b/app/src/components/compose/CanvasToolbar.tsx @@ -50,7 +50,10 @@ export function CanvasToolbar({ if (!selectedFigure) return; const newDepth = direction === 'up' ? selectedFigure.z_depth + 1 : Math.max(0, selectedFigure.z_depth - 1); - updateFigure.mutate({ id: selectedFigure.id, data: { z_depth: newDepth } }); + updateFigure.mutate( + { id: selectedFigure.id, data: { z_depth: newDepth } }, + { onError: (err) => toast.error(err.message) }, + ); } function downloadPanel(file: PanelFile, panelCount: number, dpi: number) { diff --git a/app/src/components/compose/CompositionCanvas.tsx b/app/src/components/compose/CompositionCanvas.tsx index 9724e16..8807c22 100644 --- a/app/src/components/compose/CompositionCanvas.tsx +++ b/app/src/components/compose/CompositionCanvas.tsx @@ -104,14 +104,20 @@ export function CompositionCanvas({ projectId, figures, surface }: CompositionCa const handleDragEnd = useCallback( (figureId: string, normX: number, normY: number) => { - updateFigure.mutate({ id: figureId, data: { position_x: normX, position_y: normY } }); + updateFigure.mutate( + { id: figureId, data: { position_x: normX, position_y: normY } }, + { onError: (err) => toast.error(err.message) }, + ); }, [updateFigure], ); const handleScaleChange = useCallback( (figureId: string, scale: number) => { - updateFigure.mutate({ id: figureId, data: { scale } }); + updateFigure.mutate( + { id: figureId, data: { scale } }, + { onError: (err) => toast.error(err.message) }, + ); }, [updateFigure], );