diff --git a/platform/app/public/config/default.js b/platform/app/public/config/default.js index 5a3494153..782e4a6fe 100644 --- a/platform/app/public/config/default.js +++ b/platform/app/public/config/default.js @@ -483,3 +483,20 @@ window.config = { }, ], }; + +function waitForElement(selector, maxAttempts = 20, interval = 25) { + return new Promise(resolve => { + let attempts = 0; + + const checkForElement = setInterval(() => { + const element = document.querySelector(selector); + + if (element || attempts >= maxAttempts) { + clearInterval(checkForElement); + resolve(); + } + + attempts++; + }, interval); + }); +}