mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-09 22:24:23 +08:00
Fix the original missing menu options
This commit is contained in:
parent
355991ecc9
commit
e32072ab34
@ -766,10 +766,19 @@ app.registerExtension({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_addExtraNodeContextMenu(node, app) {
|
_addExtraNodeContextMenu(node, app) {
|
||||||
node.prototype.getExtraMenuOptions = function (_, options) {
|
const origGetExtraMenuOptions = node.prototype.getExtraMenuOptions;
|
||||||
if (isOutputNode(node)) {
|
node.prototype.getExtraMenuOptions = function (_, options) {
|
||||||
|
origGetExtraMenuOptions?.apply?.(this, arguments);
|
||||||
|
if (isOutputNode(node)) {
|
||||||
const { potential_outputs } = getPotentialOutputsAndOutputNodes([this]);
|
const { potential_outputs } = getPotentialOutputsAndOutputNodes([this]);
|
||||||
const hasOutput = potential_outputs.length > 0;
|
const hasOutput = potential_outputs.length > 0;
|
||||||
|
|
||||||
|
// Check if the previous menu option is `null`. If it's not,
|
||||||
|
// then we need to add a `null` as a separator.
|
||||||
|
if (options[options.length - 1] !== null) {
|
||||||
|
options.push(null);
|
||||||
|
}
|
||||||
|
|
||||||
options.push({
|
options.push({
|
||||||
content: "🏞️ Share Output",
|
content: "🏞️ Share Output",
|
||||||
disabled: !hasOutput,
|
disabled: !hasOutput,
|
||||||
@ -793,6 +802,6 @@ app.registerExtension({
|
|||||||
}
|
}
|
||||||
}, null);
|
}, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user