From 36ae4339acfd6a539b5fb9f0ceb561853ec48b46 Mon Sep 17 00:00:00 2001 From: Mark Tolmacs Date: Tue, 28 Oct 2025 12:40:51 +0100 Subject: [PATCH] fix: Restore removal of deleted elements on restore --- excalidraw-app/data/LocalData.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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,