Skip to content

Commit

Permalink
fix: update main post timestamp when rescheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
gasoved authored and julianlam committed Feb 16, 2023
1 parent 1b29dbb commit edd2fc3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/topics/scheduled.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ 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',
`uid:${uid}:topics`,
'topics:tid',
`cid:${cid}:uid:${uid}:tids`,
], timestamp, tid),
posts.setPostField(mainPid, 'timestamp', timestamp),
shiftPostTimes(tid, timestamp),
]);
return topics.updateLastPostTimeFromLastPid(tid);
Expand Down

0 comments on commit edd2fc3

Please sign in to comment.