fix: prevent adding images to library via contextMenu (#4264)
This commit is contained in:
parent
e60e48e67d
commit
34a382ace9
@ -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…
x
Reference in New Issue
Block a user