Skip to content

Commit 3120d85

Browse files
committed
Fix postedAt callback
1 parent 395200d commit 3120d85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/nova-posts/lib/callbacks/callbacks_posts_new.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ addCallback("posts.new.sync", PostsNewDuplicateLinksCheck);
8181
// addCallback("posts.new.sync", PostsNewRequiredPropertiesCheck);
8282

8383
/**
84-
* @summary Set the post's postedAt if it's approved
84+
* @summary Set the post's postedAt if it's going to be approved
8585
*/
8686
function PostsSetPostedAt (post, user) {
87-
if (!post.postedAt && Posts.isApproved(post)) post.postedAt = new Date();
87+
if (!post.postedAt && Posts.getDefaultStatus(user) === Posts.config.STATUS_APPROVED) post.postedAt = new Date();
8888
return post;
8989
}
9090
addCallback("posts.new.sync", PostsSetPostedAt);

0 commit comments

Comments
 (0)