typecheck-fix

This commit is contained in:
Untone 2024-07-13 10:53:35 +03:00
parent f916e9f9ae
commit 645e65751b
3 changed files with 7 additions and 4 deletions

View File

@ -2,7 +2,7 @@
### How to start
Use `bun i`, `npm i`, `pnpm i` or `yarn` to install packages. Then generate cert and key file for devserver with `mkcert localhost`.
Use `bun i`, `npm i`, `pnpm i` or `yarn` to install packages.
### Config of variables

View File

@ -1,8 +1,10 @@
[English](README.en.md)
## Рекомендации по настройке разработки
### Как начать
Используйте `bun i`, `npm i`, `pnpm i` или `yarn`, чтобы установить пакеты. Затем сгенерируйте сертификат и файл ключа для devserver с помощью `mkcert localhost`.
Используйте `bun i`, `npm i`, `pnpm i` или `yarn`, чтобы установить пакеты.
### Настройка переменных

View File

@ -2,7 +2,7 @@ import { type RouteDefinition, type RouteSectionProps, createAsync } from '@soli
import { Show, Suspense, createEffect, createSignal, onMount } from 'solid-js'
import { useTopics } from '~/context/topics'
import { loadShouts, loadTopics } from '~/graphql/api/public'
import { LoadShoutsOptions } from '~/graphql/schema/core.gen'
import { LoadShoutsOptions, Shout } from '~/graphql/schema/core.gen'
import { byStat } from '~/lib/sortby'
import { restoreScrollPosition, saveScrollPosition } from '~/utils/scroll'
import { HomeView, HomeViewProps } from '../components/Views/Home'
@ -11,6 +11,7 @@ import { PageLayout } from '../components/_shared/PageLayout'
import { useLocalize } from '../context/localize'
export const SHOUTS_PER_PAGE = 20
type SortFunction<Shout> = (a: Shout, b: Shout) => number
const fetchAllTopics = async () => {
const allTopicsLoader = loadTopics()
@ -87,7 +88,7 @@ export default function HomePage(props: RouteSectionProps<HomeViewProps>) {
...((await featuredShoutsLoader()) || props.data?.featuredShouts || [])
]
const sortFn = byStat('viewed')
const topViewedShouts = featuredShouts?.sort(sortFn) || []
const topViewedShouts = featuredShouts?.sort(sortFn as SortFunction<Shout>) || []
const result = {
...prev,
...props.data,