Skip to content

Commit fbb3afb

Browse files
authored
Fix duplicate listener name collision between DuplicateBlock and Arpe… (#5806)
* Fix duplicate listener name collision between DuplicateBlock and ArpeggioBlock Signed-off-by: Ady0333 <adityashinde1525@gmail.com> * Format FlowBlocks.js to pass Prettier check Signed-off-by: Ady0333 <adityashinde1525@gmail.com> --------- Signed-off-by: Ady0333 <adityashinde1525@gmail.com>
1 parent f855408 commit fbb3afb

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

js/blocks/FlowBlocks.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function setupFlowBlocks(activity) {
178178
tur.singer.duplicateFactor *= factor;
179179

180180
// Queue each block in the clamp
181-
const listenerName = "_duplicate_" + turtle;
181+
const listenerName = "_duplicate_" + turtle + "_" + blk;
182182
logo.setDispatchBlock(blk, turtle, listenerName);
183183

184184
// Function to look for other turtles in the connection store
@@ -1178,9 +1178,8 @@ function setupFlowBlocks(activity) {
11781178
) {
11791179
logo.statusFields.push([blk, "duplicate"]);
11801180
} else {
1181-
activity.blocks.blockList[blk].value = activity.turtles.ithTurtle(
1182-
turtle
1183-
).singer.duplicateFactor;
1181+
activity.blocks.blockList[blk].value =
1182+
activity.turtles.ithTurtle(turtle).singer.duplicateFactor;
11841183
}
11851184
}
11861185
}

js/blocks/IntervalsBlocks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ function setupIntervalsBlocks(activity) {
777777
}
778778

779779
// Queue each block in the clamp.
780-
const listenerName = "_duplicate_" + turtle;
780+
const listenerName = "_duplicate_" + turtle + "_" + blk;
781781
logo.setDispatchBlock(blk, turtle, listenerName);
782782

783783
const __lookForOtherTurtles = function (blk, turtle) {

0 commit comments

Comments
 (0)