From 3b921972905891e36079cbb273903b058b68b73a Mon Sep 17 00:00:00 2001 From: Subhas Pramanik Date: Thu, 19 Dec 2024 06:34:36 +0530 Subject: [PATCH] removed clear confirmation during load project (#4153) --- js/activity.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/activity.js b/js/activity.js index d0393eff77..6c18a6aec7 100644 --- a/js/activity.js +++ b/js/activity.js @@ -1082,7 +1082,7 @@ class Activity { document.body.appendChild(modal); }; - this._allClear = (noErase) => { + this._allClear = (noErase, skipConfirmation = false) => { const clearCanvasAction = () => { this.blocks.activeBlock = null; hideDOMLabel(); @@ -1130,7 +1130,11 @@ class Activity { } }; - renderClearConfirmation(clearCanvasAction); + if (skipConfirmation) { + clearCanvasAction(); + } else { + renderClearConfirmation(clearCanvasAction); + } }; /** * Sets up play button functionality; runs Music Blocks. @@ -3723,7 +3727,7 @@ class Activity { document.querySelector("#myOpenFile").click(); window.scroll(0, 0); doHardStopButton(that); - that._allClear(true); + that._allClear(true, true); }; window.prepareExport = this.prepareExport;