From 03779697e7f680fdf678f8559654ece0620fa039 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 23 Jan 2014 11:38:41 -0500 Subject: [PATCH] FIX: Could navigate back to "Preferences" from "Change Email" --- .../javascripts/discourse/routes/preferences_routes.js | 10 ++++++---- app/assets/javascripts/discourse/routes/user_route.js | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/routes/preferences_routes.js b/app/assets/javascripts/discourse/routes/preferences_routes.js index 1b2209931..d0a0b7986 100644 --- a/app/assets/javascripts/discourse/routes/preferences_routes.js +++ b/app/assets/javascripts/discourse/routes/preferences_routes.js @@ -11,10 +11,6 @@ Discourse.PreferencesRoute = Discourse.RestrictedUserRoute.extend({ return this.modelFor('user'); }, - renderTemplate: function() { - this.render('preferences', { into: 'user', outlet: 'userOutlet', controller: 'preferences' }); - }, - setupController: function(controller, model) { controller.set('model', model); this.controllerFor('user').set('indexStream', false); @@ -51,6 +47,12 @@ Discourse.PreferencesRoute = Discourse.RestrictedUserRoute.extend({ } }); +Discourse.PreferencesIndexRoute = Discourse.RestrictedUserRoute.extend({ + renderTemplate: function() { + this.render('preferences', { into: 'user', outlet: 'userOutlet', controller: 'preferences' }); + }, +}); + /** The route for editing a user's "About Me" bio. diff --git a/app/assets/javascripts/discourse/routes/user_route.js b/app/assets/javascripts/discourse/routes/user_route.js index 41faade43..a07572244 100644 --- a/app/assets/javascripts/discourse/routes/user_route.js +++ b/app/assets/javascripts/discourse/routes/user_route.js @@ -25,7 +25,6 @@ Discourse.UserRoute = Discourse.Route.extend({ }, model: function(params) { - // If we're viewing the currently logged in user, return that object // instead. var currentUser = Discourse.User.current();