From 129e0fbca566a4b1c17d33940bced6c3ce05b720 Mon Sep 17 00:00:00 2001 From: Amoghavarsha Kudaligi Date: Mon, 2 Dec 2024 17:08:22 +0530 Subject: [PATCH] Fix post merge conflicts bug. --- .../explorable-explanations/src/modules/auctions.js | 4 ++-- .../explorable-explanations/src/modules/bubbles.js | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/explorable-explanations/src/modules/auctions.js b/packages/explorable-explanations/src/modules/auctions.js index 5afabbbb5..ca055a8a1 100644 --- a/packages/explorable-explanations/src/modules/auctions.js +++ b/packages/explorable-explanations/src/modules/auctions.js @@ -486,7 +486,7 @@ auction.draw = (index) => { const x = props.x(); const y = props.y(); - if (window.cancelPromise) { + if (app.cancelPromise) { return; } // eslint-disable-next-line no-await-in-loop @@ -501,7 +501,7 @@ auction.draw = (index) => { callBack(returnValue); } if (!app.isRevisitingNodeInInteractiveMode) { - if (window.cancelPromise) { + if (app.cancelPromise) { return; } await utils.delay(delay); // eslint-disable-line no-await-in-loop diff --git a/packages/explorable-explanations/src/modules/bubbles.js b/packages/explorable-explanations/src/modules/bubbles.js index 1953c98e7..76f8f151c 100644 --- a/packages/explorable-explanations/src/modules/bubbles.js +++ b/packages/explorable-explanations/src/modules/bubbles.js @@ -140,7 +140,7 @@ bubbles.barrageAnimation = async (index) => { utils.wipeAndRecreateInterestCanvas(); for (let i = 0; i < positionsOfCircles.length; i++) { - if (window.cancelPromise) { + if (app.cancelPromise) { resolve(); return; } @@ -175,7 +175,8 @@ bubbles.barrageAnimation = async (index) => { y > topOfBox && y < topOfBox + height ); - }) + }) || + app.cancelPromise ) { resolve(); } else { @@ -277,7 +278,7 @@ bubbles.reverseBarrageAnimation = async (index) => { utils.wipeAndRecreateInterestCanvas(); for (let i = 0; i < positionsOfCircles.length; i++) { - if (window.cancelPromise) { + if (app.cancelPromise) { resolve(); return; } @@ -309,7 +310,8 @@ bubbles.reverseBarrageAnimation = async (index) => { Math.abs(circle.y - circle.target.y) < app.bubbles.minifiedCircleDiameter / 2 ); - }) + }) || + app.cancelPromise ) { resolve(); document.getElementById('interest-canvas').style.zIndex = 2;