From 3437513025be11fe3cd31091b6aafec869a1c014 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 25 May 2015 13:40:46 -0400 Subject: [PATCH] FIX: Back button mobile from user activity stream --- .../javascripts/discourse/routes/user-index.js.es6 | 9 ++++++++- .../discourse/templates/mobile/discovery/topics.hbs | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/routes/user-index.js.es6 b/app/assets/javascripts/discourse/routes/user-index.js.es6 index 1a9cc9101c8cd4..24a536237e2037 100644 --- a/app/assets/javascripts/discourse/routes/user-index.js.es6 +++ b/app/assets/javascripts/discourse/routes/user-index.js.es6 @@ -1,7 +1,14 @@ export default Discourse.Route.extend({ beforeModel: function() { - this.transitionTo('userActivity'); + // HACK: Something with the way the user card intercepts clicks seems to break how the + // transition into a user's activity works. This makes the back button work on mobile + // where there is no user card as well as desktop where there is. + if (Discourse.Mobile.mobileView) { + this.replaceWith('userActivity'); + } else { + this.transitionTo('userActivity'); + } } }); diff --git a/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs index 4267c64e5e9aa8..82f0e59d791907 100644 --- a/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs +++ b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs @@ -16,13 +16,13 @@ {{topic-list showPosters=true currentUser=currentUser - hideCategory=hideCategory - topics=topics}} + hideCategory=model.hideCategory + topics=model.topics}} {{/if}}