mirror of
https://github.com/excalidraw/excalidraw.git
synced 2024-11-10 11:35:52 +01:00
fix: Don't show export and delete when library is empty (#3288)
This commit is contained in:
parent
efb6d0825b
commit
13d9374cde
@ -144,34 +144,37 @@ const LibraryMenuItems = ({
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ToolButton
|
{!!library.length && (
|
||||||
key="export"
|
<>
|
||||||
type="button"
|
<ToolButton
|
||||||
title={t("buttons.export")}
|
key="export"
|
||||||
aria-label={t("buttons.export")}
|
type="button"
|
||||||
icon={exportFile}
|
title={t("buttons.export")}
|
||||||
onClick={() => {
|
aria-label={t("buttons.export")}
|
||||||
saveLibraryAsJSON()
|
icon={exportFile}
|
||||||
.catch(muteFSAbortError)
|
onClick={() => {
|
||||||
.catch((error) => {
|
saveLibraryAsJSON()
|
||||||
setAppState({ errorMessage: error.message });
|
.catch(muteFSAbortError)
|
||||||
});
|
.catch((error) => {
|
||||||
}}
|
setAppState({ errorMessage: error.message });
|
||||||
/>
|
});
|
||||||
<ToolButton
|
}}
|
||||||
key="reset"
|
/>
|
||||||
type="button"
|
<ToolButton
|
||||||
title={t("buttons.resetLibrary")}
|
key="reset"
|
||||||
aria-label={t("buttons.resetLibrary")}
|
type="button"
|
||||||
icon={trash}
|
title={t("buttons.resetLibrary")}
|
||||||
onClick={() => {
|
aria-label={t("buttons.resetLibrary")}
|
||||||
if (window.confirm(t("alerts.resetLibrary"))) {
|
icon={trash}
|
||||||
Library.resetLibrary();
|
onClick={() => {
|
||||||
setLibraryItems([]);
|
if (window.confirm(t("alerts.resetLibrary"))) {
|
||||||
}
|
Library.resetLibrary();
|
||||||
}}
|
setLibraryItems([]);
|
||||||
/>
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<a
|
<a
|
||||||
href={`https://libraries.excalidraw.com?referrer=${referrer}`}
|
href={`https://libraries.excalidraw.com?referrer=${referrer}`}
|
||||||
target="_excalidraw_libraries"
|
target="_excalidraw_libraries"
|
||||||
|
Loading…
Reference in New Issue
Block a user