Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: Library load button does not work (#5205)

zsviczian605aa554d047
diff --git a/src/components/LibraryMenuItems.tsx b/src/components/LibraryMenuItems.tsx
index 4ed58720b2..61887b857d 100644
--- a/src/components/LibraryMenuItems.tsx
+++ b/src/components/LibraryMenuItems.tsx
@@ -110,13 +110,17 @@ const LibraryMenuItems = ({
icon={load}
onClick={async () => {
try {
- await fileOpen({
- description: "Excalidraw library files",
- // ToDo: Be over-permissive until https://bugs.webkit.org/show_bug.cgi?id=34442
- // gets resolved. Else, iOS users cannot open `.excalidraw` files.
- /*
- extensions: [".json", ".excalidrawlib"],
- */
+ await library.updateLibrary({
+ libraryItems: fileOpen({
+ description: "Excalidraw library files",
+ // ToDo: Be over-permissive until https://bugs.webkit.org/show_bug.cgi?id=34442
+ // gets resolved. Else, iOS users cannot open `.excalidraw` files.
+ /*
+ extensions: [".json", ".excalidrawlib"],
+ */
+ }),
+ merge: true,
+ openLibraryMenu: true,
});
} catch (error: any) {
if (error?.name === "AbortError") {