From cfca2dbbabc56871fb8e18f5f0b450f4399dcd82 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 31 Jan 2024 17:59:03 +0300 Subject: [PATCH] debug-subs --- src/context/following.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/context/following.tsx b/src/context/following.tsx index 2246485f..b22f8db1 100644 --- a/src/context/following.tsx +++ b/src/context/following.tsx @@ -80,17 +80,13 @@ export const FollowingProvider = (props: { children: JSX.Element }) => { } } - const loadData = (_a?: Author) => { - // console.debug('[context.following] current subs:', subscriptions) - if (!subscriptions?.authors?.length && !subscriptions?.topics?.length) { + createEffect(() => { + if (author() && !subscriptions?.authors?.length && !subscriptions?.topics?.length) { // && subscriptions.communites?.length + console.debug('[context.following] author with no subs detected') fetchData() } - } - createEffect(() => { - if (author()) loadData() }) - onMount(loadData) const setFollowing = (what: FollowingEntity, slug: string, value = true) => { setSubscriptions((prevSubscriptions) => {