From c5897972fda65dcd1c82e94ac70785744a1d9050 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 4 Mar 2015 15:12:28 +1100 Subject: [PATCH] FIX: do not stage posts on mobile, we have no cooked --- app/assets/javascripts/discourse/models/composer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/models/composer.js b/app/assets/javascripts/discourse/models/composer.js index d8277785456..1d07c938eb8 100644 --- a/app/assets/javascripts/discourse/models/composer.js +++ b/app/assets/javascripts/discourse/models/composer.js @@ -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.