From a6ac97e69f7c4ff7c9ddabfae77126a1b1b93f99 Mon Sep 17 00:00:00 2001 From: Justin DiRose Date: Fri, 8 Nov 2019 10:41:56 -0600 Subject: [PATCH] FIX: Stop loading more if initial topic list less than limit In cases where the initial topic list is less than 30 and the viewport is short enough to scroll, an additional set of topics would load. This commit prevents a load more link from being generated in those instances. --- lib/knowledge_explorer/query.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/knowledge_explorer/query.rb b/lib/knowledge_explorer/query.rb index b3e21a8..1622b80 100644 --- a/lib/knowledge_explorer/query.rb +++ b/lib/knowledge_explorer/query.rb @@ -61,6 +61,7 @@ module KnowledgeExplorer else offset = 0 page_range = @limit + end_of_list = true if results_length < @limit end results = results[offset...page_range]