2022-11-18 10:37:22 +01:00
|
|
|
<script setup lang="ts">
|
2023-01-08 07:21:09 +01:00
|
|
|
import type { Paginator, mastodon } from 'masto'
|
2022-11-18 10:37:22 +01:00
|
|
|
|
|
|
|
const { paginator } = defineProps<{
|
2023-01-08 07:21:09 +01:00
|
|
|
paginator: Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
|
2022-11-18 10:37:22 +01:00
|
|
|
}>()
|
2023-01-21 22:53:02 +01:00
|
|
|
|
|
|
|
function preprocess(items: mastodon.v1.Conversation[]) {
|
|
|
|
const filteredIndices = items.map(
|
|
|
|
(items, index) => (
|
|
|
|
{
|
|
|
|
status: items.lastStatus,
|
|
|
|
index,
|
|
|
|
}))
|
|
|
|
.filter(item => !!item.status?.filtered?.find(filter => filter.filter.filterAction === 'hide' && filter.filter.context.includes('thread')))
|
|
|
|
.map(item => item.index)
|
|
|
|
|
|
|
|
return items.filter((_, index) => !filteredIndices.includes(index))
|
|
|
|
}
|
2022-11-18 10:37:22 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-01-21 22:53:02 +01:00
|
|
|
<CommonPaginator :paginator="paginator" :preprocess="preprocess">
|
2022-11-18 10:37:22 +01:00
|
|
|
<template #default="{ item }">
|
|
|
|
<ConversationCard
|
|
|
|
:conversation="item"
|
2022-11-23 03:16:31 +01:00
|
|
|
border="b base" py-1
|
2022-11-18 10:37:22 +01:00
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</CommonPaginator>
|
|
|
|
</template>
|