Skip to content

Node.js based forum software built for the modern web

fix: make sort work with world filters

Oplikocd8a91fe8956
diff --git a/public/src/client/world.js b/public/src/client/world.js
index 8ab38a02c1..c9d1d14957 100644
--- a/public/src/client/world.js
+++ b/public/src/client/world.js
@@ -7,7 +7,7 @@ define('forum/world', ['topicList', 'sort', 'hooks', 'alerts', 'api'], function
app.enterRoom('world');
topicList.init('world');
- sort.handleSort('categoryTopicSort', 'world');
+ sort.handleSort('categoryTopicSort', 'world' + (ajaxify.data.filter ? '/' + ajaxify.data.filter : ''));
handleIgnoreWatch(-1);
diff --git a/src/controllers/activitypub/topics.js b/src/controllers/activitypub/topics.js
index 87afe4862c..0ab855bd74 100644
--- a/src/controllers/activitypub/topics.js
+++ b/src/controllers/activitypub/topics.js
@@ -90,6 +90,8 @@ controller.list = async function (req, res) {
}
}
+ data.filter = req.params.filter || undefined;
+
const pageCount = Math.max(1, Math.ceil(data.topicCount / topicsPerPage));
data.pagination = pagination.create(page, pageCount, req.query);
helpers.addLinkTags({