misc: make community cards consistent

This commit is contained in:
Xylight committed 2024-06-12 14:00:41 -07:00
1 parent dd1dce9b6b
commit eef339bf4c
9 files changed
+47 -131

No files matched your search

+4 -1
View File
@@ -1,4 +1,4 @@
import { profile } from '$lib/auth.js'
import { profile, type Profile } from '$lib/auth.js'
import { getClient } from '$lib/lemmy.js'
import { trycatch } from '$lib/util.js'
import type { Community, MyUserInfo, PersonView } from 'lemmy-js-client'
@@ -62,3 +62,6 @@ export const addAdmin = async (handle: string, added: boolean, jwt: string) =>
person_id: user.person.person.id,
})
})
export const hasFavorite = (profile: Profile, id: number): boolean =>
profile?.favorites?.map((i) => i.id).includes(id) ?? false