diff --git a/src/components/Nav/Header/Header.tsx b/src/components/Nav/Header/Header.tsx index b81c313f..2c26a015 100644 --- a/src/components/Nav/Header/Header.tsx +++ b/src/components/Nav/Header/Header.tsx @@ -220,7 +220,7 @@ export const Header = (props: Props) => { onMouseOut={hideSubnavigation} href="/topic" active={isTopicsVisible()} - body={t('topics')} + body={t('Topics')} onClick={(event: MouseEvent) => handleToggleMenuByLink(event, 'topic')} /> { {t('Dogma')}
  • - {t('Community Principles')} + {t('Our principles')}
  • {t('Platform Guide')} diff --git a/src/components/Views/AllAuthors/AllAuthors.tsx b/src/components/Views/AllAuthors/AllAuthors.tsx index 76d677d3..c33ad2fc 100644 --- a/src/components/Views/AllAuthors/AllAuthors.tsx +++ b/src/components/Views/AllAuthors/AllAuthors.tsx @@ -34,11 +34,11 @@ export const AllAuthors = (props: Props) => { const [searchParams] = useSearchParams<{ by?: string }>() const { authorsSorted, addAuthors, setAuthorsSort } = useAuthors() createEffect(on(() => searchParams?.by || 'name', setAuthorsSort, {})) - createEffect(() => addAuthors?.([...(props.authors || [])])) + createEffect(on(() => props.authors || [], addAuthors, {})) const filteredAuthors = createMemo(() => { const query = searchQuery().toLowerCase() - return authorsSorted?.().filter((a: Author) => a?.name?.toLowerCase().includes(query)) + return authorsSorted?.()?.filter((a: Author) => a?.name?.toLowerCase().includes(query)) || [] }) const byLetterFiltered = createMemo<{ [letter: string]: Author[] }>(() => { @@ -165,7 +165,7 @@ export const AllAuthors = (props: Props) => { diff --git a/src/components/Views/AllTopics/AllTopics.tsx b/src/components/Views/AllTopics/AllTopics.tsx index e5c23224..18aedc5c 100644 --- a/src/components/Views/AllTopics/AllTopics.tsx +++ b/src/components/Views/AllTopics/AllTopics.tsx @@ -1,7 +1,7 @@ import { Meta } from '@solidjs/meta' import { A, useSearchParams } from '@solidjs/router' import { clsx } from 'clsx' -import { For, Show, createEffect, createMemo, createSignal, on } from 'solid-js' +import { For, Show, createEffect, createMemo, createSignal, on, onMount } from 'solid-js' import { Loading } from '~/components/_shared/Loading' import { SearchField } from '~/components/_shared/SearchField' import { useLocalize } from '~/context/localize' @@ -31,8 +31,9 @@ export const AllTopics = (props: Props) => { const alphabet = createMemo(() => ABC[lang()]) const { setTopicsSort, sortedTopics } = useTopics() const topics = createMemo(() => sortedTopics() || props.topics) - const [searchParams] = useSearchParams<{ by?: string }>() - createEffect(on(() => searchParams?.by || 'shouts', setTopicsSort, {})) + const [searchParams, changeSearchParams] = useSearchParams<{ by?: string }>() + createEffect(on(() => searchParams?.by || 'shouts', setTopicsSort, {defer:true})) + onMount(() => setTimeout(() => !searchParams?.by && changeSearchParams({ by: 'shouts'}), 1)) // sorted derivative const byLetter = createMemo<{ [letter: string]: Topic[] }>(() => { diff --git a/src/context/topics.tsx b/src/context/topics.tsx index 2cf848b2..93f45a87 100644 --- a/src/context/topics.tsx +++ b/src/context/topics.tsx @@ -113,7 +113,7 @@ export const TopicsProvider = (props: { children: JSX.Element }) => { createEffect(() => { const topics = Object.values(topicEntities()) - console.debug('[context.topics] effect trig', topics) + // console.debug('[context.topics] effect trig', topics) switch (sortAllBy()) { case 'followers': { topics.sort(byTopicStatDesc('followers')) diff --git a/src/routes/author/(all-authors).tsx b/src/routes/author/(all-authors).tsx index 55cfe50b..d6abafd0 100644 --- a/src/routes/author/(all-authors).tsx +++ b/src/routes/author/(all-authors).tsx @@ -1,9 +1,8 @@ import { RouteDefinition, RouteLoadFuncArgs, type RouteSectionProps, createAsync } from '@solidjs/router' -import { Suspense, createEffect } from 'solid-js' +import { Suspense } from 'solid-js' import { AllAuthors } from '~/components/Views/AllAuthors' import { Loading } from '~/components/_shared/Loading' import { PageLayout } from '~/components/_shared/PageLayout' -import { useAuthors } from '~/context/authors' import { useLocalize } from '~/context/localize' import { ReactionsProvider } from '~/context/reactions' import { loadAuthors } from '~/graphql/api/public' @@ -48,9 +47,7 @@ export const route = { export default function AllAuthorsPage(props: RouteSectionProps<{ authors: Author[] }>) { const { t } = useLocalize() - const authors = createAsync(async () => props.data.authors || (await fetchData()) || []) - const { addAuthors } = useAuthors() - createEffect(() => addAuthors(authors() || [])) + const authors = createAsync(async () => props.data.authors || await fetchData()) return (