-
}>
diff --git a/src/context/authors.tsx b/src/context/authors.tsx
index 901b20a7..d8bd9209 100644
--- a/src/context/authors.tsx
+++ b/src/context/authors.tsx
@@ -56,7 +56,7 @@ export const AuthorsProvider = (props: { children: JSX.Element }) => {
const [authorsSorted, setAuthorsSorted] = createSignal
([])
const [sortBy, setSortBy] = createSignal>()
const { feedByAuthor } = useFeed()
- const setAuthorsSort = (stat: string) => setSortBy((_) => byStat(stat) as SortFunction)
+ const setAuthorsSort = (stat: string) => setSortBy(() => byStat(stat) as SortFunction)
// Эффект для отслеживания изменений сигнала sortBy и обновления authorsSorted
createEffect(
@@ -64,7 +64,7 @@ export const AuthorsProvider = (props: { children: JSX.Element }) => {
[sortBy, authorsEntities],
([sortfn, authorsdict]) => {
if (sortfn) {
- setAuthorsSorted?.([...filterAndSort(Object.values(authorsdict), sortfn)])
+ setAuthorsSorted([...filterAndSort(Object.values(authorsdict), sortfn)])
}
},
{ defer: true }
@@ -101,6 +101,17 @@ export const AuthorsProvider = (props: { children: JSX.Element }) => {
}
}
+ const loadAuthorsPaginated = async (args: QueryLoad_Authors_ByArgs): Promise => {
+ try {
+ const fetcher = await loadAuthors(args)
+ const data = await fetcher()
+ if (data) addAuthors(data as Author[])
+ } catch (error) {
+ console.error('Error loading authors:', error)
+ throw error
+ }
+ }
+
const topAuthors = createMemo(() => {
const articlesByAuthorMap = feedByAuthor?.() || {}
@@ -125,17 +136,6 @@ export const AuthorsProvider = (props: { children: JSX.Element }) => {
return sortedTopAuthors
})
- const loadAuthorsPaginated = async (args: QueryLoad_Authors_ByArgs): Promise => {
- try {
- const fetcher = await loadAuthors(args)
- const data = await fetcher()
- if (data) addAuthors(data as Author[])
- } catch (error) {
- console.error('Error loading authors:', error)
- throw error
- }
- }
-
const authorsByTopic = createMemo(() => {
const articlesByAuthorMap = feedByAuthor?.() || {}
const result: { [topicSlug: string]: Author[] } = {}