Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: don't render due to zoom after unmount (#2779)

David Luzar04c46fc01a55
diff --git a/src/components/App.tsx b/src/components/App.tsx
index cdee1645a0..3126d0f17c 100644
--- a/src/components/App.tsx
+++ b/src/components/App.tsx
@@ -3816,7 +3816,9 @@ class App extends React.Component<ExcalidrawProps, AppState> {
};
private resetShouldCacheIgnoreZoomDebounced = debounce(() => {
- this.setState({ shouldCacheIgnoreZoom: false });
+ if (!this.unmounted) {
+ this.setState({ shouldCacheIgnoreZoom: false });
+ }
}, 300);
private getCanvasOffsets(offsets?: {
diff --git a/src/packages/excalidraw/CHANGELOG.md b/src/packages/excalidraw/CHANGELOG.md
index 865a644702..5b4be70a1d 100644
--- a/src/packages/excalidraw/CHANGELOG.md
+++ b/src/packages/excalidraw/CHANGELOG.md
@@ -31,6 +31,7 @@ Please add the latest change on the top under the correct section.
### Fixes
+- Fix late-render due to debounced zoom [#2779](https://github.com/excalidraw/excalidraw/pull/2779)
- Fix initialization when browser tab not focused [#2677](https://github.com/excalidraw/excalidraw/pull/2677)
- Consistent case for export locale strings [#2622](https://github.com/excalidraw/excalidraw/pull/2622)
- Remove unnecessary console.error as it was polluting Sentry [#2637](https://github.com/excalidraw/excalidraw/pull/2637)