postmerge-fix

This commit is contained in:
Untone 2024-04-25 13:53:51 +03:00
parent e38d3b39b7
commit 23326b10f7
2 changed files with 4 additions and 3 deletions

View File

@ -75,7 +75,7 @@ export const AuthorView = (props: Props) => {
const bioContainerRef: { current: HTMLDivElement } = { current: null }
const bioWrapperRef: { current: HTMLDivElement } = { current: null }
const fetchData = async (author: Author) => {
const fetchData = async (slug: string) => {
try {
const [subscriptionsResult, followersResult, authorResult] = await Promise.all([
apiClient.getAuthorFollows({ slug }),
@ -134,7 +134,7 @@ export const AuthorView = (props: Props) => {
createEffect(() => {
if (author()) {
fetchData(author())
fetchData(author().slug)
fetchComments(author())
}
})

View File

@ -2,7 +2,7 @@ import { Accessor, JSX, createContext, createEffect, createMemo, createSignal, u
import { createStore } from 'solid-js/store'
import { apiClient } from '../graphql/client/core'
import { Author, AuthorFollowsResult, FollowingEntity } from '../graphql/schema/core.gen'
import { Author, AuthorFollowsResult, FollowingEntity, Community, Topic } from '../graphql/schema/core.gen'
import { useSession } from './session'
@ -64,6 +64,7 @@ export const FollowingProvider = (props: { children: JSX.Element }) => {
console.info('[context.following] subs:', subscriptions)
})
const [subscribeInAction, setSubscribeInAction] = createSignal<SubscribeAction>()
const follow = async (what: FollowingEntity, slug: string) => {
if (!author()) return
setSubscribeInAction({ slug, type: 'subscribe' })