refactor: migrate to nuxt compatibilityVersion: 4 (#3298)
This commit is contained in:
parent
46e4433e1c
commit
a3fbc056a9
342 changed files with 1200 additions and 2932 deletions
25
app/components/conversation/ConversationPaginator.vue
Normal file
25
app/components/conversation/ConversationPaginator.vue
Normal file
|
@ -0,0 +1,25 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
|
||||
defineProps<{
|
||||
paginator: mastodon.Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
|
||||
}>()
|
||||
|
||||
function preprocess(items: mastodon.v1.Conversation[]): mastodon.v1.Conversation[] {
|
||||
const isAuthored = (conversation: mastodon.v1.Conversation) => conversation.lastStatus ? conversation.lastStatus.account.id === currentUser.value?.account.id : false
|
||||
return items.filter(item => isAuthored(item) || !item.lastStatus?.filtered?.find(
|
||||
filter => filter.filter.filterAction === 'hide' && filter.filter.context.includes('thread'),
|
||||
))
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<CommonPaginator :paginator="paginator" :preprocess="preprocess">
|
||||
<template #default="{ item }">
|
||||
<ConversationCard
|
||||
:conversation="item"
|
||||
border="b base" py-1
|
||||
/>
|
||||
</template>
|
||||
</CommonPaginator>
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue