mirror of
https://ghfast.top/https://github.com/discourse/discourse-ai.git
synced 2026-07-17 11:46:28 +08:00
Allows related topics to show up for logged on users - Introduces a new "Related Topics" block above suggested when related topics exist - Renames `ai_embeddings_semantic_suggested_topics_anons_enabled` -> `ai_embeddings_semantic_suggested_topics_enabled` (given it is only deployed on 1 site not bothering with a migration) - Adds an integration test to ensure data arrives correctly on the client
15 lines
363 B
JavaScript
15 lines
363 B
JavaScript
export default {
|
|
shouldRender(args) {
|
|
return (args.model.related_topics?.length || 0) > 0;
|
|
},
|
|
setupComponent(args, component) {
|
|
if (component.model.related_topics) {
|
|
component.set(
|
|
"relatedTopics",
|
|
component.model.related_topics.map((topic) =>
|
|
this.store.createRecord("topic", topic)
|
|
)
|
|
);
|
|
}
|
|
},
|
|
};
|