From 408bfe7ac947fa38595557d545d812ba0fe49892 Mon Sep 17 00:00:00 2001 From: Andrey Panov Date: Wed, 18 Mar 2020 11:41:14 +0300 Subject: [PATCH] do not try to load library before auth --- src/code.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/code.js b/src/code.js index 25ace02b..abb9a0e4 100644 --- a/src/code.js +++ b/src/code.js @@ -486,7 +486,9 @@ switchClass(elements.logoutLink, displayNoneClass, hide); } + var currentAuthState; function switchAuthState(state) { + currentAuthState = state; configState(true); loginState(true); mainState(true); @@ -532,6 +534,8 @@ clearTimeout(loadTimeout); } + if (!lastSearch.ownObj && !lastSearch.catObj && !lastSearch.text.trim()) return; + waitForLoad = true; loadTimeout = setTimeout(function () { if (shouldLoadMore(holder)) { @@ -551,6 +555,7 @@ } function shouldLoadMore(holder) { + if (currentAuthState != "main") return false; if (holder.scrollTop + holder.clientHeight < holder.scrollHeight) return false; if ((!lastSearch.ownObj || !lastSearch.ownObj.next) && (lastSearch.catObj && !lastSearch.catObj.next)) return false;