misc: switch to universal vote function
This commit is contained in:
1 parent
8915759031
commit
76b9864a3b
9 files changed
+134
-102
No files matched your search
@@ -11,7 +11,12 @@
|
||||
import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
|
||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
|
||||
import { isComment, isCommunity, isPost, isUser } from '$lib/lemmy/item.js'
|
||||
import {
|
||||
isCommentView,
|
||||
isCommunityView,
|
||||
isPostView,
|
||||
isUser,
|
||||
} from '$lib/lemmy/item.js'
|
||||
import { searchParam } from '$lib/util.js'
|
||||
import type {
|
||||
CommentView,
|
||||
@@ -112,11 +117,11 @@
|
||||
{/await}
|
||||
<div class="flex flex-col gap-4 mt-4">
|
||||
{#each data.results as result}
|
||||
{#if isPost(result)}
|
||||
{#if isPostView(result)}
|
||||
<Post post={result} />
|
||||
{:else if isComment(result)}
|
||||
{:else if isCommentView(result)}
|
||||
<CommentItem comment={result} />
|
||||
{:else if isCommunity(result)}
|
||||
{:else if isCommunityView(result)}
|
||||
<CommunityItem community={result} />
|
||||
{:else if isUser(result)}
|
||||
<UserItem user={result} />
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||
import { page } from '$app/stores'
|
||||
import { goto } from '$app/navigation'
|
||||
import { isComment } from '$lib/lemmy/item.js'
|
||||
import { isCommentView } from '$lib/lemmy/item.js'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import { isBlocked } from '$lib/lemmy/user.js'
|
||||
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
|
||||
@@ -165,9 +165,9 @@
|
||||
/>
|
||||
</div>
|
||||
{#each data.items as item (item.counts.id)}
|
||||
{#if isComment(item) && (data.type == 'all' || data.type == 'comments')}
|
||||
{#if isCommentView(item) && (data.type == 'all' || data.type == 'comments')}
|
||||
<CommentItem comment={item} />
|
||||
{:else if !isComment(item) && (data.type == 'all' || data.type == 'posts')}
|
||||
{:else if !isCommentView(item) && (data.type == 'all' || data.type == 'posts')}
|
||||
<Post post={item} />
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
Reference in new issue
Block a user