diff --git a/excalidraw-app/data/LocalData.ts b/excalidraw-app/data/LocalData.ts index e4f472d82f..13cdf09ac4 100644 --- a/excalidraw-app/data/LocalData.ts +++ b/excalidraw-app/data/LocalData.ts @@ -27,6 +27,7 @@ import { } from "idb-keyval"; import { appJotaiStore, atom } from "excalidraw-app/app-jotai"; +import { getNonDeletedElements } from "@excalidraw/element"; import type { LibraryPersistedData } from "@excalidraw/excalidraw/data/library"; import type { ImportedDataState } from "@excalidraw/excalidraw/data/types"; @@ -87,7 +88,7 @@ const saveDataStateToLocalStorage = ( localStorage.setItem( STORAGE_KEYS.LOCAL_STORAGE_ELEMENTS, - JSON.stringify(elements), + JSON.stringify(getNonDeletedElements(elements)), ); localStorage.setItem( STORAGE_KEYS.LOCAL_STORAGE_APP_STATE,