Fix zoom being set to NaN (#807)

* Fix zoom being set to NaN

* recover zoom default value on restore if invalid

Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
Jed Fox 2020-02-22 08:37:04 -05:00 committed by GitHub
parent d342cae2ae
commit 4e489bfb6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -398,6 +398,10 @@ function restore(
savedState = { ...savedState, ...calculateScrollCenter(elements) };
}
if (savedState) {
savedState.zoom = savedState.zoom || getDefaultAppState().zoom;
}
return {
elements: elements,
appState: savedState,