Skip to content

A platform for community discussion. Free, open, simple.

FIX: Ensure topic steam is loaded before rendering the map (#28031)

Jan Cernika4692609e4ec
diff --git a/app/assets/javascripts/discourse/app/components/topic-map/index.gjs b/app/assets/javascripts/discourse/app/components/topic-map/index.gjs
index ac0b0bac3ee..5b929ed8d9d 100644
--- a/app/assets/javascripts/discourse/app/components/topic-map/index.gjs
+++ b/app/assets/javascripts/discourse/app/components/topic-map/index.gjs
@@ -12,26 +12,26 @@ const TopicMap = <template>
@postStream={{@postStream}}
/>
</section>
- {{/unless}}
-
- <section class="topic-map__additional-contents toggle-summary">
- <PluginOutlet
- @name="topic-map-expanded-after"
- @defaultGlimmer={{true}}
- @outletArgs={{hash topic=@model postStream=@postStream}}
- />
- </section>
- {{#if @showPMMap}}
- <section class="topic-map__private-message-map">
- <PrivateMessageMap
- @topicDetails={{@topicDetails}}
- @showInvite={{@showInvite}}
- @removeAllowedGroup={{@removeAllowedGroup}}
- @removeAllowedUser={{@removeAllowedUser}}
+ <section class="topic-map__additional-contents toggle-summary">
+ <PluginOutlet
+ @name="topic-map-expanded-after"
+ @defaultGlimmer={{true}}
+ @outletArgs={{hash topic=@model postStream=@postStream}}
/>
</section>
- {{/if}}
+
+ {{#if @showPMMap}}
+ <section class="topic-map__private-message-map">
+ <PrivateMessageMap
+ @topicDetails={{@topicDetails}}
+ @showInvite={{@showInvite}}
+ @removeAllowedGroup={{@removeAllowedGroup}}
+ @removeAllowedUser={{@removeAllowedUser}}
+ />
+ </section>
+ {{/if}}
+ {{/unless}}
</template>;
export default TopicMap;
diff --git a/app/assets/javascripts/discourse/app/controllers/topic.js b/app/assets/javascripts/discourse/app/controllers/topic.js
index 60afcbc0dfd..2414940e9a7 100644
--- a/app/assets/javascripts/discourse/app/controllers/topic.js
+++ b/app/assets/javascripts/discourse/app/controllers/topic.js
@@ -240,9 +240,9 @@ export default Controller.extend(bufferedProperty("model"), {
return Category.findById(categoryId)?.minimumRequiredTags || 0;
},
- @discourseComputed("model.posts_count")
- showBottomTopicMap(postsCount) {
- return postsCount > MIN_POSTS_COUNT;
+ @discourseComputed("model.posts_count", "model.postStream.loadingFilter")
+ showBottomTopicMap(postsCount, loading) {
+ return !loading && postsCount > MIN_POSTS_COUNT;
},
_removeDeleteOnOwnerReplyBookmarks() {