Skip to content

Commit

Permalink
fix: closes #12246, direction is passed in as string as query param w…
Browse files Browse the repository at this point in the history
…ith new api call

cid isn't necessary in query params since its in path
  • Loading branch information
barisusakli committed Dec 27, 2023
1 parent a74b514 commit 8867f24
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion public/src/client/category.js
Expand Up @@ -127,7 +127,6 @@ define('forum/category', [
hooks.fire('action:topics.loading');
const params = utils.params();
infinitescroll.loadMore(`/categories/${ajaxify.data.cid}/topics`, {
cid: ajaxify.data.cid,
after: after,
direction: direction,
query: params,
Expand Down
2 changes: 1 addition & 1 deletion src/api/categories.js
Expand Up @@ -128,7 +128,7 @@ categoriesAPI.getTopics = async (caller, data) => {

let start = Math.max(0, parseInt(data.after || 0, 10));

if (data.direction === -1) {
if (parseInt(data.direction, 10) === -1) {
start -= infScrollTopicsPerPage;
}

Expand Down
2 changes: 1 addition & 1 deletion src/socket.io/topics/infinitescroll.js
Expand Up @@ -30,7 +30,7 @@ module.exports = function (SocketTopics) {
parseInt(data.count, 10) || meta.config.postsPerPage || 20
));

if (data.direction === -1) {
if (parseInt(data.direction, 10) === -1) {
start -= infScrollPostsPerPage;
}

Expand Down

0 comments on commit 8867f24

Please sign in to comment.