From 327f2cb1cf075eab8cd5de5c00daa4ffe49f3587 Mon Sep 17 00:00:00 2001 From: Ibrahim Date: Fri, 4 Oct 2024 12:16:56 -0400 Subject: [PATCH] update --- platform/app/public/config/default.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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); + }); +}