fix: prevent adding images to library via contextMenu (#4264)

This commit is contained in:
David Luzar 2021-11-17 21:06:26 +01:00 committed by GitHub
parent e60e48e67d
commit 34a382ace9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) => {