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

pull/4277/head
David Luzar 3 years ago committed by GitHub
parent e60e48e67d
commit 34a382ace9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save