From 31fedfe083c4730671db51b373b961fed76975cb Mon Sep 17 00:00:00 2001 From: cyrillefr Date: Fri, 2 May 2025 09:06:36 +0200 Subject: [PATCH] Fixes StimulusJS error on printing w bulk action --- app/webpacker/controllers/file_loading_controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/webpacker/controllers/file_loading_controller.js b/app/webpacker/controllers/file_loading_controller.js index b77cca4d1d..e3f5189425 100644 --- a/app/webpacker/controllers/file_loading_controller.js +++ b/app/webpacker/controllers/file_loading_controller.js @@ -14,7 +14,7 @@ export default class extends Controller { } checkFile() { - if (!this.loadedTarget.classList.contains(HIDE_CLASS)) { + if (!this.hasLoadedTarget || !this.loadedTarget.classList.contains(HIDE_CLASS)) { // If link already loaded successfully, we don't need to check anymore. return; } @@ -29,10 +29,10 @@ export default class extends Controller { }); } - setTimeout(){ + setTimeout() { this.timeout = setTimeout(this.checkFile.bind(this), NOTIFICATION_TIME); } - clearTimeout(){ + clearTimeout() { clearTimeout(this.timeout); } }