Change follow logic
This commit is contained in:
parent
5c4d605724
commit
edf4400627
|
@ -89,4 +89,30 @@
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.actionButton {
|
||||||
|
border-radius: 0.8rem !important;
|
||||||
|
margin-right: 0 !important;
|
||||||
|
width: 9em;
|
||||||
|
|
||||||
|
&.iconed {
|
||||||
|
padding: 6px !important;
|
||||||
|
min-width: 4rem;
|
||||||
|
width: unset;
|
||||||
|
|
||||||
|
&:hover img {
|
||||||
|
filter: invert(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.actionButtonLabel {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actionButtonLabelHovered {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ import { CheckButton } from '../../_shared/CheckButton'
|
||||||
import { ConditionalWrapper } from '../../_shared/ConditionalWrapper'
|
import { ConditionalWrapper } from '../../_shared/ConditionalWrapper'
|
||||||
import { Icon } from '../../_shared/Icon'
|
import { Icon } from '../../_shared/Icon'
|
||||||
import { Userpic } from '../Userpic'
|
import { Userpic } from '../Userpic'
|
||||||
import stylesButton from '../../_shared/Button/Button.module.scss'
|
|
||||||
import styles from './AuthorBadge.module.scss'
|
import styles from './AuthorBadge.module.scss'
|
||||||
import { BadgeSubscribeButton } from "../../_shared/BadgeSubscribeButton";
|
import { BadgeSubscribeButton } from "../../_shared/BadgeSubscribeButton";
|
||||||
|
|
||||||
|
@ -131,56 +130,8 @@ export const AuthorBadge = (props: Props) => {
|
||||||
<BadgeSubscribeButton
|
<BadgeSubscribeButton
|
||||||
action={() => handleFollowClick()}
|
action={() => handleFollowClick()}
|
||||||
isSubscribed={isSubscribed()}
|
isSubscribed={isSubscribed()}
|
||||||
|
actionMessageType={subscribeInAction()?.slug === props.author.slug ? subscribeInAction().type : undefined}
|
||||||
/>
|
/>
|
||||||
{/*<Show*/}
|
|
||||||
{/* when={!props.minimizeSubscribeButton}*/}
|
|
||||||
{/* fallback={<CheckButton text={t('Follow')} checked={isSubscribed()} onClick={handleFollowClick} />}*/}
|
|
||||||
{/*>*/}
|
|
||||||
{/* <Show*/}
|
|
||||||
{/* when={isSubscribed()}*/}
|
|
||||||
{/* fallback={*/}
|
|
||||||
{/* <Button*/}
|
|
||||||
{/* variant={props.iconButtons ? 'secondary' : 'bordered'}*/}
|
|
||||||
{/* size="S"*/}
|
|
||||||
{/* value={*/}
|
|
||||||
{/* <Show when={props.iconButtons} fallback={t('Subscribe')}>*/}
|
|
||||||
{/* <Icon name="author-subscribe" class={stylesButton.icon} />*/}
|
|
||||||
{/* </Show>*/}
|
|
||||||
{/* }*/}
|
|
||||||
{/* onClick={handleFollowClick}*/}
|
|
||||||
{/* isSubscribeButton={true}*/}
|
|
||||||
{/* class={clsx(styles.actionButton, {*/}
|
|
||||||
{/* [styles.iconed]: props.iconButtons,*/}
|
|
||||||
{/* [stylesButton.subscribed]: isSubscribed(),*/}
|
|
||||||
{/* })}*/}
|
|
||||||
{/* />*/}
|
|
||||||
{/* }*/}
|
|
||||||
{/* >*/}
|
|
||||||
{/* <Button*/}
|
|
||||||
{/* variant={props.iconButtons ? 'secondary' : 'bordered'}*/}
|
|
||||||
{/* size="S"*/}
|
|
||||||
{/* value={*/}
|
|
||||||
{/* <Show*/}
|
|
||||||
{/* when={props.iconButtons}*/}
|
|
||||||
{/* fallback={*/}
|
|
||||||
{/* <>*/}
|
|
||||||
{/* <span class={styles.actionButtonLabel}>{t('Following')}</span>*/}
|
|
||||||
{/* <span class={styles.actionButtonLabelHovered}>{t('Unfollow')}</span>*/}
|
|
||||||
{/* </>*/}
|
|
||||||
{/* }*/}
|
|
||||||
{/* >*/}
|
|
||||||
{/* <Icon name="author-unsubscribe" class={stylesButton.icon} />*/}
|
|
||||||
{/* </Show>*/}
|
|
||||||
{/* }*/}
|
|
||||||
{/* onClick={handleFollowClick}*/}
|
|
||||||
{/* isSubscribeButton={true}*/}
|
|
||||||
{/* class={clsx(styles.actionButton, {*/}
|
|
||||||
{/* [styles.iconed]: props.iconButtons,*/}
|
|
||||||
{/* [stylesButton.subscribed]: isSubscribed(),*/}
|
|
||||||
{/* })}*/}
|
|
||||||
{/* />*/}
|
|
||||||
{/* </Show>*/}
|
|
||||||
{/*</Show>*/}
|
|
||||||
<Show when={props.showMessageButton}>
|
<Show when={props.showMessageButton}>
|
||||||
<Button
|
<Button
|
||||||
variant={props.iconButtons ? 'secondary' : 'bordered'}
|
variant={props.iconButtons ? 'secondary' : 'bordered'}
|
||||||
|
|
|
@ -296,9 +296,13 @@ export const AuthorCard = (props: Props) => {
|
||||||
<For each={authorSubs()}>
|
<For each={authorSubs()}>
|
||||||
{(subscription) =>
|
{(subscription) =>
|
||||||
isAuthor(subscription) ? (
|
isAuthor(subscription) ? (
|
||||||
<AuthorBadge author={subscription} />
|
<AuthorBadge
|
||||||
|
author={subscription}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<TopicBadge topic={subscription}/>
|
<TopicBadge
|
||||||
|
topic={subscription}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</For>
|
</For>
|
||||||
|
|
|
@ -24,7 +24,6 @@ export const TopicBadge = (props: Props) => {
|
||||||
const { mediaMatches } = useMediaQuery()
|
const { mediaMatches } = useMediaQuery()
|
||||||
const [isMobileView, setIsMobileView] = createSignal(false)
|
const [isMobileView, setIsMobileView] = createSignal(false)
|
||||||
const { requireAuthentication } = useSession()
|
const { requireAuthentication } = useSession()
|
||||||
const { setFollowing, loading: subLoading } = useFollowing()
|
|
||||||
const [isSubscribed, setIsSubscribed] = createSignal<boolean>()
|
const [isSubscribed, setIsSubscribed] = createSignal<boolean>()
|
||||||
const { follow, unfollow, subscriptions, subscribeInAction } = useFollowing()
|
const { follow, unfollow, subscriptions, subscribeInAction } = useFollowing()
|
||||||
|
|
||||||
|
@ -36,7 +35,7 @@ export const TopicBadge = (props: Props) => {
|
||||||
|
|
||||||
const handleFollowClick = () => {
|
const handleFollowClick = () => {
|
||||||
requireAuthentication(() => {
|
requireAuthentication(() => {
|
||||||
follow(FollowingEntity.Topic, props.topic.slug)
|
isSubscribed() ? follow(FollowingEntity.Topic, props.topic.slug) : unfollow(FollowingEntity.Topic, props.topic.slug)
|
||||||
}, 'subscribe')
|
}, 'subscribe')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +77,11 @@ export const TopicBadge = (props: Props) => {
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class={styles.actions}>
|
<div class={styles.actions}>
|
||||||
<BadgeSubscribeButton isSubscribed={isSubscribed()} action={handleFollowClick}/>
|
<BadgeSubscribeButton
|
||||||
|
isSubscribed={isSubscribed()}
|
||||||
|
action={handleFollowClick}
|
||||||
|
actionMessageType={subscribeInAction()?.slug === props.topic.slug ? subscribeInAction().type : undefined}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class={styles.stats}>
|
<div class={styles.stats}>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import type { Author, Reaction, Shout, Topic } from '../../../graphql/schema/cor
|
||||||
import { getPagePath } from '@nanostores/router'
|
import { getPagePath } from '@nanostores/router'
|
||||||
import { Meta, Title } from '@solidjs/meta'
|
import { Meta, Title } from '@solidjs/meta'
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import { For, Match, Show, Switch, createEffect, createMemo, createSignal, onMount } from 'solid-js'
|
import { For, Match, Show, Switch, createEffect, createMemo, createSignal, onMount, on } from "solid-js";
|
||||||
|
|
||||||
import { useFollowing } from '../../../context/following'
|
import { useFollowing } from '../../../context/following'
|
||||||
import { useLocalize } from '../../../context/localize'
|
import { useLocalize } from '../../../context/localize'
|
||||||
|
@ -48,13 +48,11 @@ export const AuthorView = (props: Props) => {
|
||||||
const [commented, setCommented] = createSignal<Reaction[]>()
|
const [commented, setCommented] = createSignal<Reaction[]>()
|
||||||
|
|
||||||
// current author
|
// current author
|
||||||
console.log('%c!!! :', 'color: #bada55', props.author)
|
// const [author, _] = createSignal<Author>(props.author)
|
||||||
const [author, setAuthor] = createSignal<Author>(props.author)
|
|
||||||
|
|
||||||
createEffect(async () => {
|
createEffect(async () => {
|
||||||
if (author()?.id && !author().stat) {
|
if (props.author?.id && !props.author.stat) {
|
||||||
const a = await loadAuthor({ slug: '', author_id: author().id })
|
const a = await loadAuthor({ slug: '', author_id: props.author.id })
|
||||||
console.log('%c!!! A2:', 'color: #bada55', props.author)
|
|
||||||
console.debug('[AuthorView] loaded author:', a)
|
console.debug('[AuthorView] loaded author:', a)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -63,14 +61,11 @@ export const AuthorView = (props: Props) => {
|
||||||
const bioWrapperRef: { current: HTMLDivElement } = { current: null }
|
const bioWrapperRef: { current: HTMLDivElement } = { current: null }
|
||||||
|
|
||||||
const fetchData = async (author: Author) => {
|
const fetchData = async (author: Author) => {
|
||||||
console.log('%c!!! slug:', 'color: #bada55', author)
|
|
||||||
try {
|
try {
|
||||||
const [subscriptionsResult, followersResult] = await Promise.all([
|
const [subscriptionsResult, followersResult] = await Promise.all([
|
||||||
apiClient.getAuthorFollows({ author_id: author.id }),
|
apiClient.getAuthorFollows({ author_id: author.id }),
|
||||||
apiClient.getAuthorFollowers({ slug: author.slug }),
|
apiClient.getAuthorFollowers({ slug: author.slug }),
|
||||||
])
|
])
|
||||||
console.log('%c!!! subscriptionsResult:', 'color: #bada55', subscriptionsResult)
|
|
||||||
console.log('%c!!! followersResult:', 'color: #bada55', followersResult)
|
|
||||||
const { authors, topics } = subscriptionsResult
|
const { authors, topics } = subscriptionsResult
|
||||||
setFollowing([...(authors || []), ...(topics || [])])
|
setFollowing([...(authors || []), ...(topics || [])])
|
||||||
setFollowers(followersResult || [])
|
setFollowers(followersResult || [])
|
||||||
|
@ -99,7 +94,6 @@ export const AuthorView = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
fetchData(author())
|
|
||||||
checkBioHeight()
|
checkBioHeight()
|
||||||
// pagination
|
// pagination
|
||||||
if (sortedArticles().length === PRERENDERED_ARTICLES_COUNT) {
|
if (sortedArticles().length === PRERENDERED_ARTICLES_COUNT) {
|
||||||
|
@ -118,41 +112,46 @@ export const AuthorView = (props: Props) => {
|
||||||
setCommented(data)
|
setCommented(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(
|
||||||
if (author()) {
|
on(
|
||||||
fetchComments(author())
|
() => props.author,
|
||||||
}
|
() => {
|
||||||
})
|
fetchData(props.author)
|
||||||
|
fetchComments(props.author)
|
||||||
|
},
|
||||||
|
{ defer: true },
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
const ogImage = createMemo(() =>
|
const ogImage = createMemo(() =>
|
||||||
author()?.pic
|
props.author?.pic
|
||||||
? getImageUrl(author()?.pic, { width: 1200 })
|
? getImageUrl(props.author?.pic, { width: 1200 })
|
||||||
: getImageUrl('production/image/logo_image.png'),
|
: getImageUrl('production/image/logo_image.png'),
|
||||||
)
|
)
|
||||||
const description = createMemo(() => getDescription(author()?.bio))
|
const description = createMemo(() => getDescription(props.author?.bio))
|
||||||
const handleDeleteComment = (id: number) => {
|
const handleDeleteComment = (id: number) => {
|
||||||
setCommented((prev) => prev.filter((comment) => comment.id !== id))
|
setCommented((prev) => prev.filter((comment) => comment.id !== id))
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class={styles.authorPage}>
|
<div class={styles.authorPage}>
|
||||||
<Show when={author()}>
|
<Show when={props.author}>
|
||||||
<Title>{author().name}</Title>
|
<Title>{props.author.name}</Title>
|
||||||
<Meta name="descprition" content={description()} />
|
<Meta name="descprition" content={description()} />
|
||||||
<Meta name="og:type" content="profile" />
|
<Meta name="og:type" content="profile" />
|
||||||
<Meta name="og:title" content={author().name} />
|
<Meta name="og:title" content={props.author.name} />
|
||||||
<Meta name="og:image" content={ogImage()} />
|
<Meta name="og:image" content={ogImage()} />
|
||||||
<Meta name="og:description" content={description()} />
|
<Meta name="og:description" content={description()} />
|
||||||
<Meta name="twitter:card" content="summary_large_image" />
|
<Meta name="twitter:card" content="summary_large_image" />
|
||||||
<Meta name="twitter:title" content={author().name} />
|
<Meta name="twitter:title" content={props.author.name} />
|
||||||
<Meta name="twitter:description" content={description()} />
|
<Meta name="twitter:description" content={description()} />
|
||||||
<Meta name="twitter:image" content={ogImage()} />
|
<Meta name="twitter:image" content={ogImage()} />
|
||||||
</Show>
|
</Show>
|
||||||
<div class="wide-container">
|
<div class="wide-container">
|
||||||
<Show when={author()} fallback={<Loading />}>
|
<Show when={props.author} fallback={<Loading />}>
|
||||||
<>
|
<>
|
||||||
<div class={styles.authorHeader}>
|
<div class={styles.authorHeader}>
|
||||||
<AuthorCard author={author()} followers={followers()} following={following()} />
|
<AuthorCard author={props.author} followers={followers()} following={following()} />
|
||||||
</div>
|
</div>
|
||||||
<div class={clsx(styles.groupControls, 'row')}>
|
<div class={clsx(styles.groupControls, 'row')}>
|
||||||
<div class="col-md-16">
|
<div class="col-md-16">
|
||||||
|
@ -161,16 +160,16 @@ export const AuthorView = (props: Props) => {
|
||||||
<a href={getPagePath(router, 'author', { slug: props.authorSlug })}>
|
<a href={getPagePath(router, 'author', { slug: props.authorSlug })}>
|
||||||
{t('Publications')}
|
{t('Publications')}
|
||||||
</a>
|
</a>
|
||||||
<Show when={author().stat}>
|
<Show when={props.author.stat}>
|
||||||
<span class="view-switcher__counter">{author().stat.shouts}</span>
|
<span class="view-switcher__counter">{props.author.stat.shouts}</span>
|
||||||
</Show>
|
</Show>
|
||||||
</li>
|
</li>
|
||||||
<li classList={{ 'view-switcher__item--selected': getPage().route === 'authorComments' }}>
|
<li classList={{ 'view-switcher__item--selected': getPage().route === 'authorComments' }}>
|
||||||
<a href={getPagePath(router, 'authorComments', { slug: props.authorSlug })}>
|
<a href={getPagePath(router, 'authorComments', { slug: props.authorSlug })}>
|
||||||
{t('Comments')}
|
{t('Comments')}
|
||||||
</a>
|
</a>
|
||||||
<Show when={author().stat}>
|
<Show when={props.author.stat}>
|
||||||
<span class="view-switcher__counter">{author().stat.comments}</span>
|
<span class="view-switcher__counter">{props.author.stat.comments}</span>
|
||||||
</Show>
|
</Show>
|
||||||
</li>
|
</li>
|
||||||
<li classList={{ 'view-switcher__item--selected': getPage().route === 'authorAbout' }}>
|
<li classList={{ 'view-switcher__item--selected': getPage().route === 'authorAbout' }}>
|
||||||
|
@ -206,7 +205,7 @@ export const AuthorView = (props: Props) => {
|
||||||
class={styles.longBio}
|
class={styles.longBio}
|
||||||
classList={{ [styles.longBioExpanded]: isBioExpanded() }}
|
classList={{ [styles.longBioExpanded]: isBioExpanded() }}
|
||||||
>
|
>
|
||||||
<div ref={(el) => (bioContainerRef.current = el)} innerHTML={author().about} />
|
<div ref={(el) => (bioContainerRef.current = el)} innerHTML={props.author.about} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Show when={showExpandBioControl()}>
|
<Show when={showExpandBioControl()}>
|
||||||
|
|
|
@ -27,8 +27,6 @@ export const ProfileSubscriptions = () => {
|
||||||
const [searchQuery, setSearchQuery] = createSignal('')
|
const [searchQuery, setSearchQuery] = createSignal('')
|
||||||
|
|
||||||
const fetchSubscriptions = async () => {
|
const fetchSubscriptions = async () => {
|
||||||
|
|
||||||
console.log('%c!!! :', 'color: #bada55', 'Профайл fetchSubscriptions' )
|
|
||||||
try {
|
try {
|
||||||
const slug = author()?.slug
|
const slug = author()?.slug
|
||||||
const authorFollows = await apiClient.getAuthorFollows({ slug })
|
const authorFollows = await apiClient.getAuthorFollows({ slug })
|
||||||
|
|
|
@ -1,37 +1,46 @@
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from "clsx";
|
||||||
import styles from './BadgeDubscribeButton.module.scss'
|
import styles from "./BadgeDubscribeButton.module.scss";
|
||||||
import { CheckButton } from "../CheckButton";
|
import { CheckButton } from "../CheckButton";
|
||||||
import { Show } from "solid-js";
|
import { createMemo, Show } from "solid-js";
|
||||||
import { Button } from "../Button";
|
import { Button } from "../Button";
|
||||||
import { Icon } from "../Icon";
|
import { Icon } from "../Icon";
|
||||||
import stylesButton from "../Button/Button.module.scss";
|
import stylesButton from "../Button/Button.module.scss";
|
||||||
import { useLocalize } from "../../../context/localize";
|
import { useLocalize } from "../../../context/localize";
|
||||||
|
import { useFollowing } from "../../../context/following";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
class?: string
|
class?: string;
|
||||||
isSubscribed: boolean
|
isSubscribed: boolean;
|
||||||
minimizeSubscribeButton?: boolean
|
minimizeSubscribeButton?: boolean;
|
||||||
action: () => void
|
action: () => void;
|
||||||
iconButtons?: boolean
|
iconButtons?: boolean;
|
||||||
}
|
actionMessageType?: "subscribe" | "unsubscribe";
|
||||||
|
};
|
||||||
|
|
||||||
export const BadgeSubscribeButton = (props: Props) => {
|
export const BadgeSubscribeButton = (props: Props) => {
|
||||||
const { t } = useLocalize()
|
const { t } = useLocalize();
|
||||||
|
|
||||||
|
const inActionText = createMemo(() => {
|
||||||
|
return props.actionMessageType === "subscribe" ? t("Subscribing...") : t("Unsubscribing...");
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class={props.class}>
|
<div class={props.class}>
|
||||||
<Show
|
<Show
|
||||||
when={!props.minimizeSubscribeButton}
|
when={!props.minimizeSubscribeButton}
|
||||||
fallback={<CheckButton text={t('Follow')} checked={props.isSubscribed} onClick={props.action} />}
|
fallback={<CheckButton text={t("Follow")} checked={props.isSubscribed} onClick={props.action} />}
|
||||||
>
|
>
|
||||||
<Show
|
<Show
|
||||||
when={props.isSubscribed}
|
when={props.isSubscribed}
|
||||||
fallback={
|
fallback={
|
||||||
<Button
|
<Button
|
||||||
variant={props.iconButtons ? 'secondary' : 'bordered'}
|
variant={props.iconButtons ? "secondary" : "bordered"}
|
||||||
size="S"
|
size="S"
|
||||||
value={
|
value={
|
||||||
<Show when={props.iconButtons} fallback={t('Subscribe')}>
|
<Show
|
||||||
|
when={props.iconButtons}
|
||||||
|
fallback={props.actionMessageType ? inActionText() : t("Subscribe")}
|
||||||
|
>
|
||||||
<Icon name="author-subscribe" class={stylesButton.icon} />
|
<Icon name="author-subscribe" class={stylesButton.icon} />
|
||||||
</Show>
|
</Show>
|
||||||
}
|
}
|
||||||
|
@ -45,16 +54,20 @@ export const BadgeSubscribeButton = (props: Props) => {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
variant={props.iconButtons ? 'secondary' : 'bordered'}
|
variant={props.iconButtons ? "secondary" : "bordered"}
|
||||||
size="S"
|
size="S"
|
||||||
value={
|
value={
|
||||||
<Show
|
<Show
|
||||||
when={props.iconButtons}
|
when={props.iconButtons}
|
||||||
fallback={
|
fallback={
|
||||||
|
props.actionMessageType ? (
|
||||||
|
inActionText()
|
||||||
|
) : (
|
||||||
<>
|
<>
|
||||||
<span class={styles.actionButtonLabel}>{t('Following')}</span>
|
<span class={styles.actionButtonLabel}>{t("Following")}</span>
|
||||||
<span class={styles.actionButtonLabelHovered}>{t('Unfollow')}</span>
|
<span class={styles.actionButtonLabelHovered}>{t("Unfollow")}</span>
|
||||||
</>
|
</>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Icon name="author-unsubscribe" class={stylesButton.icon} />
|
<Icon name="author-unsubscribe" class={stylesButton.icon} />
|
||||||
|
@ -70,5 +83,5 @@ export const BadgeSubscribeButton = (props: Props) => {
|
||||||
</Show>
|
</Show>
|
||||||
</Show>
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
|
@ -122,10 +122,6 @@ export const FollowingProvider = (props: { children: JSX.Element }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
createEffect(() => {
|
|
||||||
console.log('%c!!! WTF subscriptions:', 'color: #bada55', subscriptions);
|
|
||||||
})
|
|
||||||
|
|
||||||
const value: FollowingContextType = {
|
const value: FollowingContextType = {
|
||||||
loading,
|
loading,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
|
|
|
@ -92,7 +92,6 @@ export const apiClient = {
|
||||||
|
|
||||||
follow: async ({ what, slug }: { what: FollowingEntity; slug: string }) => {
|
follow: async ({ what, slug }: { what: FollowingEntity; slug: string }) => {
|
||||||
const response = await apiClient.private.mutation(followMutation, { what, slug }).toPromise()
|
const response = await apiClient.private.mutation(followMutation, { what, slug }).toPromise()
|
||||||
console.log("!!! response FOLLOW AAAA:", 'background: #222; color: #bada55', response);
|
|
||||||
return response.data.follow
|
return response.data.follow
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user