feat: add community resumables

This commit is contained in:
Xylight committed 2024-07-19 18:29:32 -07:00
1 parent 98a597c0d3
commit 47b8b21ede
4 files changed
+33 -14

No files matched your search

+8
View File
@@ -32,6 +32,7 @@
import EntityHeader from '$lib/components/ui/EntityHeader.svelte'
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
import Subscribe from '../../communities/Subscribe.svelte'
import { resumables } from '$lib/lemmy/item'
export let data
@@ -45,6 +46,13 @@
'lastSeenCommunity',
data.community.community_view.community,
)
resumables.add({
name: community.community.title,
type: 'community',
url: $page.url.toString(),
avatar: community.community.icon,
})
})
onDestroy(() => {
@@ -64,17 +64,12 @@
})
}
if (!$resumables.find((r) => r.url == $page.url.toString()))
$resumables = [
{
id: Math.floor(Math.random() * 1000000),
name: post.post_view.post.name,
type: 'post',
url: $page.url.toString(),
avatar: post.post_view.post.thumbnail_url,
},
...$resumables,
]
resumables.add({
name: post.post_view.post.name,
type: 'post',
url: $page.url.toString(),
avatar: post.post_view.post.thumbnail_url,
})
})
afterNavigate(async () => {