Skip to content

Commit 650b194

Browse files
committed
should fix false positive collaboration detection
1 parent 4b2fb59 commit 650b194

File tree

1 file changed

+8
-2
lines changed
  • src/addons/addons/collaboration/helpers

1 file changed

+8
-2
lines changed

src/addons/addons/collaboration/helpers/helper.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,14 @@ export function hasCircularDependency(blocksObject) {
408408
if (traverse(block.next)) return true;
409409
if (block.inputs) {
410410
for (const inputName in block.inputs) {
411-
// An input can be a shadow block (ID in `block.inputs[...].shadow`) or a real block (ID in `block.inputs[...].block`)
412-
if (traverse(block.inputs[inputName].block)) return true;
411+
const input = block.inputs[inputName];
412+
// The input is an array, e.g., [1, 'shadow-id'], [2, 'block-id'], [3, 'block-id', 'shadow-id']
413+
// The actual connected block is the second element (index 1).
414+
if (input && Array.isArray(input) && input.length > 1 && input[1]) {
415+
if (traverse(input[1])) {
416+
return true;
417+
}
418+
}
413419
}
414420
}
415421

0 commit comments

Comments
 (0)