feat: make subscribebd communities reflect instantly
This commit is contained in:
1 parent
709aded3a8
commit
54e3431bc4
4 files changed
+14
-10
No files matched your search
@@ -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
|
||||
</script>
|
||||
@@ -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'}
|
||||
|
||||
@@ -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}
|
||||
<div class="h-64 grid place-items-center">
|
||||
<div class="h-64 w-64 grid place-items-center">
|
||||
<Spinner width={32} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -23,13 +23,9 @@
|
||||
<Button on:click={() => (siteOpen = !siteOpen)}>Site</Button>
|
||||
</span>
|
||||
</h1>
|
||||
<Markdown source={$site.site_view.local_site.legal_information} />
|
||||
</div>
|
||||
<div class="max-lg:hidden">
|
||||
<SiteCard
|
||||
site={$site.site_view}
|
||||
admins={$site.admins}
|
||||
taglines={$site.taglines}
|
||||
<Markdown
|
||||
source={$site.site_view.local_site.legal_information ??
|
||||
'This instance does not have any legal information.'}
|
||||
/>
|
||||
</div>
|
||||
{:else}
|
||||
|
||||
@@ -50,6 +50,7 @@ body {
|
||||
#nprogress .bar {
|
||||
@apply bg-black dark:bg-white !important;
|
||||
z-index: 999 !important;
|
||||
height: 1px !important;
|
||||
}
|
||||
|
||||
#nprogress .peg {
|
||||
|
||||
Reference in new issue
Block a user