UX: Scroll to top of assigned list when switching users

UX: Scroll to top of assigned list when switching users

diff --git a/assets/javascripts/discourse-assign/routes/group-assigned-show.js.es6 b/assets/javascripts/discourse-assign/routes/group-assigned-show.js.es6
index f525851..3478794 100644
--- a/assets/javascripts/discourse-assign/routes/group-assigned-show.js.es6
+++ b/assets/javascripts/discourse-assign/routes/group-assigned-show.js.es6
@@ -6,6 +6,15 @@ export default DiscourseRoute.extend({
     ascending: { refreshModel: true }
   },
 
+  beforeModel(transition) {
+    if (!(transition.hasOwnProperty("from") && transition.from)) {
+      return;
+    }
+    if (transition.from.localName === "show") {
+      this.session.set("topicListScrollPosition", 1);
+    }
+  },
+
   model(params) {
     let filter = null;
     if (params.filter !== "everyone") {

GitHub sha: 96c3d9d1

1 Like

This commit appears in #91 which was merged by davidtaylorhq.