From 1fe7596962fcf81f9dec7e7d040139600d8487b2 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Mon, 18 Jul 2022 11:51:14 +0200 Subject: [PATCH] Fix page count --- gui/dashboard/app.svelte | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gui/dashboard/app.svelte b/gui/dashboard/app.svelte index 0b6c47d..3be21e3 100644 --- a/gui/dashboard/app.svelte +++ b/gui/dashboard/app.svelte @@ -10,7 +10,6 @@ let placesLeft = size; let pageNum = -1; let pageCount = 1; - let pageCountFreePlaces = 1; let tiles = []; let time = ''; let globalData = {}; @@ -50,12 +49,12 @@ servicesTemp = servicesDown.slice(0, size); pageCount = Math.ceil(upOrUnknown.length / size); placesLeft = size - servicesTemp.length; - pageCountFreePlaces = Math.ceil(upOrUnknown.length / placesLeft); + pageCount = Math.ceil(upOrUnknown.length / placesLeft); if (pageNum === -1 || total >= size) { pageNum++; - if (pageNum > pageCount) { + if (pageNum >= pageCount) { pageNum = 0; } } @@ -132,9 +131,12 @@