- {t('PublicationsWithCount', {
+ {t('some posts', {
count: props.topic?.stat.shouts ?? 0,
})}
diff --git a/src/components/Topic/TopicBadge/TopicBadge.tsx b/src/components/Topic/TopicBadge/TopicBadge.tsx
index a07dca47..f6429ce3 100644
--- a/src/components/Topic/TopicBadge/TopicBadge.tsx
+++ b/src/components/Topic/TopicBadge/TopicBadge.tsx
@@ -80,7 +80,7 @@ export const TopicBadge = (props: Props) => {
when={props.topic.body}
fallback={
- {t('PublicationsWithCount', { count: props.topic?.stat?.shouts ?? 0 })}
+ {t('some posts', { count: props.topic?.stat?.shouts ?? 0 })}
}
>
diff --git a/src/components/Views/Topic.tsx b/src/components/Views/Topic.tsx
index 0a56b036..a8dff6f7 100644
--- a/src/components/Views/Topic.tsx
+++ b/src/components/Views/Topic.tsx
@@ -51,23 +51,28 @@ export const TopicView = (props: Props) => {
const [topic, setTopic] = createSignal()
createEffect(
- on([() => props.topicSlug, topic, topicEntities], ([slug, t, ttt]) => {
+ on([() => props.topicSlug, topic, topicEntities], async ([slug, t, ttt]) => {
if (slug && !t && ttt) {
- console.debug(`${ttt.length} topics preloaded`)
const current = ttt[slug]
console.debug(current)
setTopic(current)
- loadTopicFollowers()
- loadTopicAuthors()
- loadRandom()
+ await loadTopicFollowers()
+ await loadTopicAuthors()
+ await loadRandom()
}
}),
)
const [followers, setFollowers] = createSignal(props.followers || [])
const loadTopicFollowers = async () => {
- const result = await apiClient.getTopicFollowers({ slug: props.topicSlug })
- setFollowers(result)
+ const flwrs = await apiClient.getTopicFollowers({ slug: props.topicSlug })
+ setFollowers(flwrs)
+ }
+ const [topicAuthors, setTopicAuthors] = createSignal([])
+ const loadTopicAuthors = async () => {
+ const by: AuthorsBy = { topic: props.topicSlug }
+ const authors = await apiClient.loadAuthorsBy({ by, limit: 10, offset: 0 })
+ setTopicAuthors(authors)
}
const loadFavoriteTopArticles = async (topic: string) => {
@@ -94,12 +99,6 @@ export const TopicView = (props: Props) => {
setReactedTopMonthArticles(result)
}
- const [topicAuthors, setTopicAuthors] = createSignal([])
- const loadTopicAuthors = async () => {
- const by: AuthorsBy = { topic: props.topicSlug }
- const result = await apiClient.loadAuthorsBy({ by })
- setTopicAuthors(result)
- }
const loadRandom = () => {
loadFavoriteTopArticles(topic()?.slug)
diff --git a/tests/basic-routes.spec.ts b/tests/basic-routes.spec.ts
index da1b2652..b904fbef 100644
--- a/tests/basic-routes.spec.ts
+++ b/tests/basic-routes.spec.ts
@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test'
-const baseHost = process.env.BASE_HOST || 'https://localhost:3000';
+const baseHost = process.env.BASE_HOST || 'https://localhost:3000'
const pagesTitles = {
'/': /Дискурс/,