FIX: Redirect to Top was showing "latest" content because it was in the

preload store.
This commit is contained in:
Robin Ward 2014-09-02 12:29:22 -04:00
parent d09f109b2c
commit abd84cd2a1
3 changed files with 3 additions and 3 deletions

View File

@ -247,7 +247,7 @@ Discourse.TopicList.reopenClass({
},
find: function(filter, params) {
return PreloadStore.getAndRemove("topic_list", finderFor(filter, params)).then(function(result) {
return PreloadStore.getAndRemove("topic_list_" + filter, finderFor(filter, params)).then(function(result) {
return Discourse.TopicList.from(result, filter, params);
});
}

View File

@ -15,7 +15,7 @@ Discourse.DiscoveryRoute = Discourse.Route.extend(Discourse.ScrollTop, Discourse
if (transition.targetName.indexOf("discovery.top") === -1 &&
Discourse.User.currentProp("should_be_redirected_to_top")) {
Discourse.User.currentProp("should_be_redirected_to_top", false);
this.transitionTo("discovery.top");
this.replaceWith("discovery.top");
}
},

View File

@ -186,7 +186,7 @@ class ListController < ApplicationController
respond_to do |format|
format.html do
@list = list
store_preloaded('topic_list', MultiJson.dump(TopicListSerializer.new(list, scope: guardian)))
store_preloaded("topic_list_#{list.filter}", MultiJson.dump(TopicListSerializer.new(list, scope: guardian)))
render 'list'
end
format.json do