From ba8bc10431c776ada887d78c511cf0f48abdbddf Mon Sep 17 00:00:00 2001 From: Gasim Gasimzada Date: Sun, 12 Jan 2020 14:08:47 +0400 Subject: [PATCH] Remove element shape object from local storage save (#336) --- src/scene/data.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scene/data.ts b/src/scene/data.ts index 9aedeb40..3ef366f7 100644 --- a/src/scene/data.ts +++ b/src/scene/data.ts @@ -187,7 +187,9 @@ export function restoreFromLocalStorage() { let elements = []; if (savedElements) { try { - elements = JSON.parse(savedElements); + elements = JSON.parse(savedElements).map( + ({ shape, ...element }: ExcalidrawElement) => element + ); } catch (e) { // Do nothing because elements array is already empty }