fix: let recent replies respect oldest/newest sort settings

This commit is contained in:
psychobunny
2021-04-11 19:53:40 -04:00
parent 0f249aa729
commit 60eed8d89f
2 changed files with 7 additions and 3 deletions

View File

@@ -116,8 +116,8 @@ SocketPosts.getReplies = async function (socket, pid) {
if (!utils.isNumber(pid)) {
throw new Error('[[error:invalid-data]]');
}
const pids = await posts.getPidsFromSet(`pid:${pid}:replies`, 0, -1, false);
const { topicPostSort } = await user.getSettings(socket.uid);
const pids = await posts.getPidsFromSet(`pid:${pid}:replies`, 0, -1, topicPostSort === 'newest_to_oldest');
let [postData, postPrivileges] = await Promise.all([
posts.getPostsByPids(pids, socket.uid),