From b162d381fac3873acd65d5399f09c59081e74916 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Wed, 26 Oct 2022 20:36:37 +0200 Subject: hide 'older' link when there is only one page --- web/pw-server/src/routes/matches/index.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'web/pw-server/src') diff --git a/web/pw-server/src/routes/matches/index.svelte b/web/pw-server/src/routes/matches/index.svelte index 9679132..e14d380 100644 --- a/web/pw-server/src/routes/matches/index.svelte +++ b/web/pw-server/src/routes/matches/index.svelte @@ -85,7 +85,8 @@ } function olderMatchesLink(matches: object[]): string { - if (matches.length == 0 || (query["before"] && !hasNext)) { + // sort order is time DESC unless "before" is set + if (matches.length == 0 || (!query["after"] && !hasNext)) { return null; } const lastTimestamp = matches[matches.length - 1]["timestamp"]; -- cgit v1.2.3