FIX: Redirecting breaks the back button.

This commit is contained in:
Guo Xiang Tan 2016-02-01 15:11:44 +08:00
parent f281f6e026
commit 8772ba2f80
2 changed files with 4 additions and 7 deletions

View File

@ -10,6 +10,7 @@ export default {
app.DiscoveryCategoryController = DiscoverySortableController.extend();
app.DiscoveryParentCategoryController = DiscoverySortableController.extend();
app.DiscoveryCategoryNoneController = DiscoverySortableController.extend();
app.DiscoveryCategoryWithIDController = DiscoverySortableController.extend();
app.DiscoveryCategoryRoute = buildCategoryRoute('latest');
app.DiscoveryParentCategoryRoute = buildCategoryRoute('latest');

View File

@ -1,11 +1,7 @@
import Category from 'discourse/models/category';
export default Discourse.Route.extend({
model: function(params) {
return Category.findById(params.id);
},
redirect: function(model) {
this.transitionTo(`/c/${Category.slugFor(model)}`);
export default Discourse.DiscoveryCategoryRoute.extend({
model(params) {
return { category: Category.findById(params.id) };
}
});