From 324b3f5c76f7580c1586e23c83a308495fe61b37 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Wed, 5 Aug 2020 12:25:08 +0200 Subject: [PATCH] #23 Fix if preloader always hidden Previous if statement did not work because it still was found in DOM so it only was pushed into the array but not executed. --- utils/aniwatchCore.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/aniwatchCore.js b/utils/aniwatchCore.js index 1a6d3b1..1951dc7 100644 --- a/utils/aniwatchCore.js +++ b/utils/aniwatchCore.js @@ -32,7 +32,8 @@ function findPreloader() { } function runAfterLoad(func, pattern = '.*') { - if (findPreloader()) { + let preloader = findPreloader(); + if (typeof preloader !== undefined && preloader.style.display !== "none") { __afterLoadScripts.push({ "function": func, "pattern": pattern }); } else { func();