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

* fix: don't render due to zoom after unmount

* update changelog

* remove unnecessary flush
This commit is contained in:
David Luzar 2021-01-13 17:42:42 +01:00 committed by GitHub
parent 49e792649d
commit 04c46fc01a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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?: {

View File

@ -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)