Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/lib/litegraph/src/subgraph/SubgraphIONodeBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export abstract class SubgraphIONodeBase<
* @param event The event that triggered the context menu.
*/
protected showSlotContextMenu(slot: TSlot, event: CanvasPointerEvent): void {
const options: IContextMenuValue[] = this.#getSlotMenuOptions(slot)
const options = this.#getSlotMenuOptions(slot)
if (!(options.length > 0)) return

new LiteGraph.ContextMenu(options, {
Expand All @@ -208,8 +208,8 @@ export abstract class SubgraphIONodeBase<
* @param slot The slot to get the context menu options for.
* @returns The context menu options.
*/
#getSlotMenuOptions(slot: TSlot): IContextMenuValue[] {
const options: IContextMenuValue[] = []
#getSlotMenuOptions(slot: TSlot): (IContextMenuValue | null)[] {
const options: (IContextMenuValue | null)[] = []

// Disconnect option if slot has connections
if (slot !== this.emptySlot && slot.linkIds.length > 0) {
Expand All @@ -218,10 +218,10 @@ export abstract class SubgraphIONodeBase<

// Remove / rename slot option (except for the empty slot)
if (slot !== this.emptySlot) {
options.push(
{ content: 'Remove Slot', value: 'remove' },
{ content: 'Rename Slot', value: 'rename' }
)
options.push({ content: 'Rename Slot', value: 'rename' }, null, {
content: 'Remove Slot',
value: 'remove'
})
}

return options
Expand Down