Fix right click not working for some users.

This commit is contained in:
comfyanonymous 2023-12-01 02:03:34 -05:00
parent c97be4db91
commit 5d5c320054
1 changed files with 2 additions and 2 deletions

View File

@ -1010,7 +1010,7 @@ function addConvertToGroupOptions() {
const getCanvasMenuOptions = LGraphCanvas.prototype.getCanvasMenuOptions;
LGraphCanvas.prototype.getCanvasMenuOptions = function () {
const options = getCanvasMenuOptions.apply(this, arguments);
const index = options.findIndex((o) => o?.content === "Add Group") + 1 || opts.length;
const index = options.findIndex((o) => o?.content === "Add Group") + 1 || options.length;
addOption(options, index);
return options;
};
@ -1020,7 +1020,7 @@ function addConvertToGroupOptions() {
LGraphCanvas.prototype.getNodeMenuOptions = function (node) {
const options = getNodeMenuOptions.apply(this, arguments);
if (!GroupNodeHandler.isGroupNode(node)) {
const index = options.findIndex((o) => o?.content === "Outputs") + 1 || opts.length - 1;
const index = options.findIndex((o) => o?.content === "Outputs") + 1 || options.length - 1;
addOption(options, index);
}
return options;