From 34a382ace93c0a131cc57c3adbf20f4b65936d5b Mon Sep 17 00:00:00 2001 From: David Luzar Date: Wed, 17 Nov 2021 21:06:26 +0100 Subject: [PATCH] fix: prevent adding images to library via contextMenu (#4264) --- src/actions/actionAddToLibrary.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/actions/actionAddToLibrary.ts b/src/actions/actionAddToLibrary.ts index 57eacc0c..0df832b0 100644 --- a/src/actions/actionAddToLibrary.ts +++ b/src/actions/actionAddToLibrary.ts @@ -8,6 +8,16 @@ import { t } from "../i18n"; export const actionAddToLibrary = register({ name: "addToLibrary", 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 .loadLibrary() .then((items) => {