FIX: Forward button would break on some topics

This commit is contained in:
Robin Ward 2014-03-07 16:28:38 -05:00
parent 1403d303b6
commit 145b2931c6

View File

@ -87,6 +87,10 @@ Discourse.TopicRoute = Discourse.Route.extend({
model: function(params) {
var currentModel = this.modelFor('topic');
if (currentModel && (currentModel.get('id') === parseInt(params.id, 10))) {
// If we've recovered the currentModel (for example, hitting the forward button and we
// popped it off the state), get rid of the `loaded` attribute we set when the back
// button was hit.
currentModel.set('postStream.loaded', true);
return currentModel;
}
return Discourse.Topic.create(params);