mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: prevent adding images to library via contextMenu (#4264)
This commit is contained in:
parent
e60e48e67d
commit
34a382ace9
1 changed files with 10 additions and 0 deletions
|
@ -8,6 +8,16 @@ import { t } from "../i18n";
|
||||||
export const actionAddToLibrary = register({
|
export const actionAddToLibrary = register({
|
||||||
name: "addToLibrary",
|
name: "addToLibrary",
|
||||||
perform: (elements, appState, _, app) => {
|
perform: (elements, appState, _, app) => {
|
||||||
|
if (elements.some((element) => element.type === "image")) {
|
||||||
|
return {
|
||||||
|
commitToHistory: false,
|
||||||
|
appState: {
|
||||||
|
...appState,
|
||||||
|
errorMessage: "Support for adding images to the library coming soon!",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return app.library
|
return app.library
|
||||||
.loadLibrary()
|
.loadLibrary()
|
||||||
.then((items) => {
|
.then((items) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue