Fix “post awaiting moderation” message

This commit is contained in:
Sacha Greif 2015-01-21 11:09:18 +09:00
parent 201af43cf9
commit 6868a69f3e
3 changed files with 8 additions and 2 deletions

View file

@ -2,6 +2,9 @@
* Adeed Grid Layout option.
* Cleaned up vote click handling functions and added tests (thanks @anthonymayer!).
* Added `threadModules` zone.
* Added `upvoteCallbacks` and `downvoteCallbacks` callback arrays.
* Fix “post awaiting moderation” message bug.
## v0.13.0 “ComponentScope”

View file

@ -29,10 +29,10 @@ AutoForm.hooks({
onSuccess: function(operation, post, template) {
template.$('button[type=submit]').removeClass('loading');
trackEvent("new post", {'postId': post._id});
Router.go('post_page', {_id: post._id});
if (post.status === STATUS_PENDING) {
flashMessage(i18n.t('thanks_your_post_is_awaiting_approval'), 'success');
}
Router.go('post_page', {_id: post._id});
},
onError: function(operation, error, template) {

View file

@ -149,10 +149,13 @@ Meteor.startup( function (){
});
// onRun Hooks
Router.onRun(filters.clearSeenMessages);
// Before Hooks
Router.onBeforeAction(filters.isReady);
Router.onBeforeAction(filters.clearSeenMessages);
Router.onBeforeAction(filters.canView, {except: ['atSignIn', 'atSignUp', 'atForgotPwd', 'atResetPwd', 'signOut']});
Router.onBeforeAction(filters.hasCompletedProfile);
Router.onBeforeAction(filters.isLoggedIn, {only: ['post_submit', 'post_edit', 'comment_reply', 'comment_edit']});