fix: #11981, post immediately when canceling scheduling

This commit is contained in:
Barış Soner Uşaklı
2023-09-06 11:00:34 -04:00
parent d79f79e82e
commit aa797f23c1
2 changed files with 28 additions and 20 deletions

View File

@@ -186,7 +186,7 @@ module.exports = function (Posts) {
throw new Error('[[error:no-privileges]]');
}
const isMain = parseInt(data.pid, 10) === parseInt(topicData.mainPid, 10);
if (isMain && (isNaN(data.timestamp) || data.timestamp < Date.now())) {
if (isMain && isNaN(data.timestamp)) {
throw new Error('[[error:invalid-data]]');
}
}