diff options
author | Vitaly Takmazov | 2022-11-20 00:09:20 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:59 +0300 |
commit | f06dbc1b6e99ad7735b9cfd4edd0efe2a835e2e2 (patch) | |
tree | 854f51c6651fd58d4960b1fdc4b5c698165806ff /vnext | |
parent | 952530f370a0d7c2d74a9c080bbe37e69745782a (diff) |
Fix paging
Diffstat (limited to 'vnext')
-rw-r--r-- | vnext/src/ui/Feeds.js | 3 |
1 files changed, 2 insertions, 1 deletions
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) => { |