mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-07 14:24:28 +01:00
fix: Restore removal of deleted elements on restore
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
|||||||
} from "idb-keyval";
|
} from "idb-keyval";
|
||||||
|
|
||||||
import { appJotaiStore, atom } from "excalidraw-app/app-jotai";
|
import { appJotaiStore, atom } from "excalidraw-app/app-jotai";
|
||||||
|
import { getNonDeletedElements } from "@excalidraw/element";
|
||||||
|
|
||||||
import type { LibraryPersistedData } from "@excalidraw/excalidraw/data/library";
|
import type { LibraryPersistedData } from "@excalidraw/excalidraw/data/library";
|
||||||
import type { ImportedDataState } from "@excalidraw/excalidraw/data/types";
|
import type { ImportedDataState } from "@excalidraw/excalidraw/data/types";
|
||||||
@@ -87,7 +88,7 @@ const saveDataStateToLocalStorage = (
|
|||||||
|
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
STORAGE_KEYS.LOCAL_STORAGE_ELEMENTS,
|
STORAGE_KEYS.LOCAL_STORAGE_ELEMENTS,
|
||||||
JSON.stringify(elements),
|
JSON.stringify(getNonDeletedElements(elements)),
|
||||||
);
|
);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
STORAGE_KEYS.LOCAL_STORAGE_APP_STATE,
|
STORAGE_KEYS.LOCAL_STORAGE_APP_STATE,
|
||||||
|
|||||||
Reference in New Issue
Block a user