Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix: reset crop box when switching to crop

httpjamesm240c7d452533
diff --git a/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx b/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
index 8c053f4717..36b4f7dfc2 100644
--- a/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
+++ b/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
@@ -278,6 +278,11 @@ const ImageEditorOverlay = (props: IProps) => {
}
}, [brightness, contrast, blur, saturation, invert, canvasRef, fileURL]);
+ useEffect(() => {
+ if (currentTab !== 'crop') return;
+ resetCropBox();
+ }, [currentTab]);
+
const applyFilters = async (canvases: HTMLCanvasElement[]) => {
try {
for (const canvas of canvases) {