We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eacc4ed commit 6456a4fCopy full SHA for 6456a4f
assets/javascripts/initializers/related-topics.gjs
@@ -47,10 +47,16 @@ export default {
47
(Superclass) =>
48
class extends Superclass {
49
@tracked related_topics;
50
+ relatedTopicsCache = [];
51
52
@cached
53
get relatedTopics() {
- return this.related_topics?.map((topic) =>
54
+ // Used to keep related topics when a user scrolls up from the
55
+ // bottom of the topic and then scrolls back down
56
+ if (this.related_topics) {
57
+ this.relatedTopicsCache = this.related_topics;
58
+ }
59
+ return this.relatedTopicsCache?.map((topic) =>
60
this.store.createRecord("topic", topic)
61
);
62
}
0 commit comments