This commit is contained in:
Untone 2024-06-28 18:26:00 +03:00
parent 4e631f5f91
commit deeb7c58cf
3 changed files with 7 additions and 6 deletions

View File

@ -30,7 +30,7 @@ export const AllTopics = (props: Props) => {
const alphabet = createMemo(() => ABC[lang()]) const alphabet = createMemo(() => ABC[lang()])
const { setTopicsSort, sortedTopics } = useTopics() const { setTopicsSort, sortedTopics } = useTopics()
const topics = createMemo(() => sortedTopics() || props.topics) const topics = createMemo(() => sortedTopics() || props.topics)
const [searchParams, ] = useSearchParams<{ by?: string }>() const [searchParams] = useSearchParams<{ by?: string }>()
createEffect(on(() => searchParams?.by || 'shouts', setTopicsSort, { defer: true })) createEffect(on(() => searchParams?.by || 'shouts', setTopicsSort, { defer: true }))
onMount(() => setTopicsSort('shouts')) onMount(() => setTopicsSort('shouts'))
// sorted derivative // sorted derivative
@ -66,7 +66,9 @@ export const AllTopics = (props: Props) => {
// filter // filter
const [searchQuery, setSearchQuery] = createSignal('') const [searchQuery, setSearchQuery] = createSignal('')
const [filteredResults, setFilteredResults] = createSignal<Topic[]>([]) const [filteredResults, setFilteredResults] = createSignal<Topic[]>([])
createEffect(() => setFilteredResults((_prev: Topic[]) => dummyFilter(topics(), searchQuery(), lang()) as Topic[])) createEffect(() =>
setFilteredResults((_prev: Topic[]) => dummyFilter(topics(), searchQuery(), lang()) as Topic[])
)
// subcomponent // subcomponent
const AllTopicsHead = () => ( const AllTopicsHead = () => (

View File

@ -1,4 +1,3 @@
import { createLazyMemo } from '@solid-primitives/memo'
import { openDB } from 'idb' import { openDB } from 'idb'
import { import {
Accessor, Accessor,