mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-27 14:08:10 +00:00
16 lines
363 B
JavaScript
16 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)
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
},
|
||
|
};
|