fix: update main post timestamp when rescheduling

This commit is contained in:
gasoved
2023-02-16 04:38:51 +03:00
committed by Julian Lam
parent 1b29dbb69d
commit edd2fc38fc

View File

@@ -60,6 +60,7 @@ Scheduled.pin = async function (tid, topicData) {
};
Scheduled.reschedule = async function ({ cid, tid, timestamp, uid }) {
const mainPid = await topics.getTopicField(tid, 'mainPid');
await Promise.all([
db.sortedSetsAdd([
'topics:scheduled',
@@ -67,6 +68,7 @@ Scheduled.reschedule = async function ({ cid, tid, timestamp, uid }) {
'topics:tid',
`cid:${cid}:uid:${uid}:tids`,
], timestamp, tid),
posts.setPostField(mainPid, 'timestamp', timestamp),
shiftPostTimes(tid, timestamp),
]);
return topics.updateLastPostTimeFromLastPid(tid);