hotfix followed request
This commit is contained in:
parent
f8a7e98a8e
commit
24c028a233
|
@ -56,35 +56,34 @@ export const AuthorView = (props: AuthorProps) => {
|
|||
const [subscribedTopics, setSubscribedTopics] = createSignal<Topic[]>([])
|
||||
|
||||
onMount(async () => {
|
||||
if (!props.author.slug) return
|
||||
try {
|
||||
const userSubscribers = await apiClient.getAuthorFollowers({ slug: props.author.slug })
|
||||
const userSubscribers = await apiClient.getAuthorFollowers({ slug: props.authorSlug })
|
||||
setFollowers(userSubscribers)
|
||||
} catch (error) {
|
||||
console.log('[getAuthorFollowers]', error)
|
||||
}
|
||||
|
||||
try {
|
||||
const authorSubscriptionsUsers = await apiClient.getAuthorFollowingUsers({ slug: props.author.slug })
|
||||
const authorSubscriptionsUsers = await apiClient.getAuthorFollowingUsers({ slug: props.authorSlug })
|
||||
setFollowingUsers(authorSubscriptionsUsers)
|
||||
} catch (error) {
|
||||
console.log('[getAuthorFollowingUsers]', error)
|
||||
}
|
||||
|
||||
try {
|
||||
const authorSubscriptionsTopics = await apiClient.getAuthorFollowingTopics({
|
||||
slug: props.author.slug
|
||||
})
|
||||
const authorSubscriptionsTopics = await apiClient.getAuthorFollowingTopics({ slug: props.authorSlug })
|
||||
setSubscribedTopics(authorSubscriptionsTopics)
|
||||
} catch (error) {
|
||||
console.log('[getAuthorFollowing]', error)
|
||||
}
|
||||
})
|
||||
|
||||
onMount(() => {
|
||||
if (!searchParams().by) {
|
||||
changeSearchParam('by', 'rating')
|
||||
}
|
||||
|
||||
if (sortedArticles().length === PRERENDERED_ARTICLES_COUNT) {
|
||||
await loadMore()
|
||||
}
|
||||
})
|
||||
|
||||
const loadMore = async () => {
|
||||
|
@ -98,12 +97,6 @@ export const AuthorView = (props: AuthorProps) => {
|
|||
restoreScrollPosition()
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
if (sortedArticles().length === PRERENDERED_ARTICLES_COUNT) {
|
||||
await loadMore()
|
||||
}
|
||||
})
|
||||
|
||||
// TODO: use title
|
||||
// const title = createMemo(() => {
|
||||
// const m = searchParams().by
|
||||
|
@ -119,15 +112,6 @@ export const AuthorView = (props: AuthorProps) => {
|
|||
|
||||
const [commented, setCommented] = createSignal([])
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
const authorSubscribers = await apiClient.getAuthorFollowers({ slug: props.authorSlug })
|
||||
setFollowers(authorSubscribers)
|
||||
} catch (error) {
|
||||
console.log('[getAuthorSubscribers]', error)
|
||||
}
|
||||
})
|
||||
|
||||
createEffect(async () => {
|
||||
if (searchParams().by === 'commented') {
|
||||
try {
|
||||
|
@ -276,6 +260,7 @@ export const AuthorView = (props: AuthorProps) => {
|
|||
<Match when={searchParams().by === 'subscribed-authors'}>
|
||||
<div class="wide-container">
|
||||
<div class="row">
|
||||
asdasd
|
||||
<For each={followingUsers()}>
|
||||
{(follower: Author) => (
|
||||
<div class="col-md-6 col-lg-4">
|
||||
|
|
Loading…
Reference in New Issue
Block a user