Use passed value 'to' for mode change rather than accessing this.mode (as other getters may be in the way). Partly for #362
This commit is contained in:
@@ -103,7 +103,8 @@ class NodeModeRelay extends BaseCollectorNode {
|
||||
if (this.inputs.length <= 1 && !this.isInputConnected(0) && this.isAnyOutputConnected()) {
|
||||
const [n, v] = logger.infoParts(`Mode change without any inputs; relaying our mode.`);
|
||||
console[n]?.(...v);
|
||||
this.dispatchModeToRepeater(this.mode);
|
||||
// Pass "to" since there may be other getters in the way to access this.mode directly.
|
||||
this.dispatchModeToRepeater(to);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,8 @@ class NodeModeRepeater extends BaseCollectorNode {
|
||||
if (linkedNodes.length) {
|
||||
for (const node of linkedNodes) {
|
||||
if (node.type !== NodeTypesString.NODE_MODE_RELAY) {
|
||||
node.mode = this.mode;
|
||||
// Use "to" as there may be other getters in the way to access this.mode directly.
|
||||
node.mode = to;
|
||||
}
|
||||
}
|
||||
} else if (app.graph._groups?.length) {
|
||||
@@ -176,7 +177,10 @@ class NodeModeRepeater extends BaseCollectorNode {
|
||||
group.recomputeInsideNodes();
|
||||
if (group._nodes?.includes(this)) {
|
||||
for (const node of group._nodes) {
|
||||
node.mode = this.mode;
|
||||
if (node !== this) {
|
||||
// Use "to" as there may be other getters in the way to access this.mode directly.
|
||||
node.mode = to;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class NodeModeRelay extends BaseCollectorNode {
|
||||
if (this.inputs.length <= 1 && !this.isInputConnected(0) && this.isAnyOutputConnected()) {
|
||||
const [n, v] = logger.infoParts(`Mode change without any inputs; relaying our mode.`);
|
||||
(_a = console[n]) === null || _a === void 0 ? void 0 : _a.call(console, ...v);
|
||||
this.dispatchModeToRepeater(this.mode);
|
||||
this.dispatchModeToRepeater(to);
|
||||
}
|
||||
}
|
||||
configure(info) {
|
||||
|
||||
@@ -100,7 +100,7 @@ class NodeModeRepeater extends BaseCollectorNode {
|
||||
if (linkedNodes.length) {
|
||||
for (const node of linkedNodes) {
|
||||
if (node.type !== NodeTypesString.NODE_MODE_RELAY) {
|
||||
node.mode = this.mode;
|
||||
node.mode = to;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,9 @@ class NodeModeRepeater extends BaseCollectorNode {
|
||||
group.recomputeInsideNodes();
|
||||
if ((_b = group._nodes) === null || _b === void 0 ? void 0 : _b.includes(this)) {
|
||||
for (const node of group._nodes) {
|
||||
node.mode = this.mode;
|
||||
if (node !== this) {
|
||||
node.mode = to;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user