diff --git a/src/lib/components/lemmy/community/CommunityItem.svelte b/src/lib/components/lemmy/community/CommunityItem.svelte index 3305030c..47295b60 100644 --- a/src/lib/components/lemmy/community/CommunityItem.svelte +++ b/src/lib/components/lemmy/community/CommunityItem.svelte @@ -14,6 +14,7 @@ import { Button } from 'mono-svelte' import { isSubscribed } from '$lib/util.js' import { profile } from '$lib/auth.js' + import { addSubscription } from '$lib/lemmy/user.js' export let community: CommunityView @@ -38,10 +39,16 @@ const res = await subscribe() if (res) { - community.subscribed = + const newSubscribed = res.community_view.subscribed != 'NotSubscribed' ? 'Subscribed' : 'NotSubscribed' + + community.subscribed = newSubscribed + addSubscription( + community.community, + newSubscribed == 'Subscribed' + ) } }} color={isSubscribed(community.subscribed) ? 'elevatedLow' : 'primary'} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 3b1b1eb4..28ae47b3 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -34,7 +34,7 @@ } if (!$navigating) { if (typeof document != 'undefined') { - nProgress.done() + nProgress.done(true) document?.documentElement?.classList?.toggle('wait', false) } } @@ -122,7 +122,7 @@ version={$site.version} /> {:else} -