From 605aa554d047ff3c5d3118d51516dab73216d33c Mon Sep 17 00:00:00 2001 From: zsviczian Date: Wed, 18 May 2022 21:46:08 +0200 Subject: [PATCH] fix: Library load button does not work (#5205) Co-authored-by: dwelle --- src/components/LibraryMenuItems.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/LibraryMenuItems.tsx b/src/components/LibraryMenuItems.tsx index 4ed58720..61887b85 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") {