From bbf03cbc2822094cffe868e0710d2a8f7e1096c0 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Thu, 13 Feb 2025 20:08:44 +0100 Subject: frontend: Use current date to seed frontpage results Use the current date (year, month, and day) instead of generating a new seed every time and potentially making the user unable to go back to see results that were displayed a moment ago. This essentially makes the frontpage display daily favourites and bookmarks. Additionally make sure to set the seed in the filter when navigating to the respective category. --- frontend/operations.graphql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'frontend/operations.graphql') diff --git a/frontend/operations.graphql b/frontend/operations.graphql index 4ca665b..60efc09 100644 --- a/frontend/operations.graphql +++ b/frontend/operations.graphql @@ -401,7 +401,7 @@ query scrapeComic($id: Int!, $scraper: String!) { } } -query frontpage { +query frontpage($seed: Int!) { recent: comics(pagination: { items: 6 }, sort: { on: CREATED_AT, direction: DESCENDING }) { edges { ...Comic @@ -411,7 +411,7 @@ query frontpage { favourites: comics( pagination: { items: 6 } filter: { include: { favourite: true } } - sort: { on: RANDOM } + sort: { on: RANDOM, seed: $seed } ) { edges { ...Comic @@ -421,7 +421,7 @@ query frontpage { bookmarked: comics( pagination: { items: 6 } filter: { include: { bookmarked: true } } - sort: { on: RANDOM } + sort: { on: RANDOM, seed: $seed } ) { edges { ...Comic -- cgit v1.2.3-2-gb3c3