From f06dbc1b6e99ad7735b9cfd4edd0efe2a835e2e2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 20 Nov 2022 00:09:20 +0300 Subject: Fix paging --- vnext/src/ui/Feeds.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vnext') diff --git a/vnext/src/ui/Feeds.js b/vnext/src/ui/Feeds.js index 129be2de..d4b9e8c9 100644 --- a/vnext/src/ui/Feeds.js +++ b/vnext/src/ui/Feeds.js @@ -172,7 +172,7 @@ function Feed({ query }) { setLoading(true); let getPageParam = (pageParam, lastMessage, /** @type { URLSearchParams } */ filterParams) => { const pageValue = pageParam === 'before_mid' ? lastMessage.mid : pageParam === 'page' ? (Number(filterParams.page) || 0) + 1 : dayjs.utc(lastMessage.updated).valueOf(); - filterParams[pageParam] = pageValue; + filterParams.append(pageParam, pageValue); return `?${filterParams.toString()}`; }; let params = { ...Object.fromEntries(filter), ...query.search }; @@ -183,6 +183,7 @@ function Feed({ query }) { const { pageParam } = query; const lastMessage = data.slice(-1)[0] || {}; const nextpage = getPageParam(pageParam, lastMessage, new URLSearchParams(params)); + console.log('nextpage', nextpage); document.body.scrollTop = 0; document.documentElement.scrollTop = 0; setState((prevState) => { -- cgit v1.2.3