FIX: regression lead to a 404 when trying to filter user posts (#6893)

FIX: regression lead to a 404 when trying to filter user posts (#6893)

diff --git a/app/assets/javascripts/discourse/models/user-posts-stream.js.es6 b/app/assets/javascripts/discourse/models/user-posts-stream.js.es6
index b90af86..42347e7 100644
--- a/app/assets/javascripts/discourse/models/user-posts-stream.js.es6
+++ b/app/assets/javascripts/discourse/models/user-posts-stream.js.es6
@@ -20,17 +20,21 @@ export default Discourse.Model.extend({
     "/posts/%@/%@?offset=%@"
   ),
 
-  filterBy(filter) {
-    if (this.get("loaded") && this.get("filter") === filter) {
+  filterBy(opts) {
+    if (this.get("loaded") && this.get("filter") === opts.filter) {
       return Ember.RSVP.resolve();
     }
 
-    this.setProperties({
-      filter: filter,
-      itemsLoaded: 0,
-      canLoadMore: true,
-      content: []
-    });
+    this.setProperties(
+      Object.assign(
+        {
+          itemsLoaded: 0,
+          content: [],
+          lastLoadedUrl: null
+        },
+        opts
+      )
+    );
 
     return this.findItems();
   },

GitHub sha: 740d0473

1 Like