Don't show new user education when editing a reply.

This commit is contained in:
Robin Ward 2013-05-15 15:16:42 -04:00
parent ae78954fc0
commit b1bfda0e11
2 changed files with 5 additions and 0 deletions

View File

@ -116,6 +116,10 @@ Discourse.ComposerController = Discourse.Controller.extend({
}.property('content.composeState', 'content.reply', 'educationClosed', 'educationContents'),
fetchNewUserEducation: function() {
// We don't show education when editing a post.
if (this.get('content.editingPost')) return;
// If creating a topic, use topic_count, otherwise post_count
var count = this.get('content.creatingTopic') ? Discourse.get('currentUser.topic_count') : Discourse.get('currentUser.reply_count');
if (count >= Discourse.SiteSettings.educate_until_posts) {

View File

@ -121,6 +121,7 @@ class PostCreator
# Track the topic
TopicUser.auto_track(@user.id, topic.id, TopicUser.notification_reasons[:created_post])
# We don't count replies to your own topics
if @user.id != topic.user_id
@user.update_topic_reply_count
end