fix: make sort work with world filters

This commit is contained in:
Opliko
2024-04-06 02:26:54 +02:00
parent 5c1c1d2182
commit cd8a91fe89
2 changed files with 3 additions and 1 deletions

View File

@@ -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);

View File

@@ -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({