Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .discourse-compatibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<= 3.5.0.beta9-dev: b52439ff8c4b7629a693a9b2d9546c15678c7a8a
< 3.5.0.beta5-dev: f4ef4a41587d75d062b4fc7841d8f78e7726ea59
< 3.5.0.beta1-dev: 5fda8d63def631692e8780c6b8bc2457eae55a29
< 3.4.0.beta1-dev: 471a797e05f9b55df90ef71145420ec001f9f48d
Expand Down
20 changes: 4 additions & 16 deletions javascripts/discourse/components/category-topics.gjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { service } from "@ember/service";
import TopicLink from "discourse/components/topic-list/topic-link";
import categoryLink from "discourse/helpers/category-link";
import htmlSafe from "discourse/helpers/html-safe";
import replaceEmoji from "discourse/helpers/replace-emoji";
import getURL from "discourse/lib/get-url";
import Category from "discourse/models/category";

export default class CategoryTopics extends Component {
Expand All @@ -26,16 +24,7 @@ export default class CategoryTopics extends Component {
this.category = Category.findById(categoryId);

this.store.findFiltered("topicList", { filter }).then((result) => {
const results = result.topic_list.topics;

results.forEach((topic) => {
topic.url = `${getURL("/t/")}${topic.slug}/${topic.id}`;
if (topic.last_read_post_number > 0) {
topic.url += `/${topic.last_read_post_number}`;
}
});

this.topics = results.slice(0, count);
this.topics = result.topics.slice(0, count);
});
}

Expand All @@ -49,12 +38,11 @@ export default class CategoryTopics extends Component {

<div class="category-topics--content">
{{#each this.topics as |topic|}}
<a href={{topic.url}} class="category-topics--topic">
{{htmlSafe (replaceEmoji topic.fancy_title)}}
<TopicLink @topic={{topic}} class="category-topics--topic">
<span class="category-topics--posts-count">
({{topic.posts_count}})
</span>
</a>
</TopicLink>
{{/each}}
</div>
</template>
Expand Down