FIX: do not stage posts on mobile, we have no cooked

This commit is contained in:
Sam 2015-03-04 15:12:28 +11:00
parent 26f577dfd8
commit c5897972fd

View File

@ -540,7 +540,12 @@ Discourse.Composer = Discourse.Model.extend({
post.set('reply_count', (post.get('reply_count') || 0) + 1);
post.set('replies', []);
}
if (!postStream.stagePost(createdPost, currentUser)) {
// We do not stage posts in mobile view, we do not have the "cooked"
// Furthermore calculating cooked is very complicated, especially since
// we would need to handle oneboxes and other bits that are not even in the
// engine, staging will just cause a blank post to render
if (!Discourse.Mobile.mobileView && !postStream.stagePost(createdPost, currentUser)) {
// If we can't stage the post, return and don't save. We're likely currently
// staging a post.