@@ -4,11 +4,12 @@ import type { mastodon } from 'masto'
44import { DynamicScrollerItem } from ' vue-virtual-scroller'
55import ' vue-virtual-scroller/dist/vue-virtual-scroller.css'
66
7- const { account, buffer = 10 , endMessage = true } = defineProps <{
7+ const { account, buffer = 10 , endMessage = true , followedTags = [] } = defineProps <{
88 paginator: mastodon .Paginator <mastodon .v1 .Status [], mastodon .rest .v1 .ListAccountStatusesParams >
99 stream? : mastodon .streaming .Subscription
1010 context? : mastodon .v2 .FilterContext
1111 account? : mastodon .v1 .Account
12+ followedTags? : mastodon .v1 .Tag []
1213 preprocess? : (items : mastodon .v1 .Status []) => mastodon .v1 .Status []
1314 buffer? : number
1415 endMessage? : boolean | string
@@ -20,6 +21,12 @@ const virtualScroller = usePreferences('experimentalVirtualScroller')
2021const showOriginSite = computed (() =>
2122 account && account .id !== currentUser .value ?.account .id && getServerName (account ) !== currentServer .value ,
2223)
24+
25+ function getFollowedTag(status : mastodon .v1 .Status ): string | null {
26+ const followedTagNames = followedTags .map (tag => tag .name )
27+ const followedStatusTags = status .tags .filter (tag => followedTagNames .includes (tag .name ))
28+ return followedStatusTags .length ? followedStatusTags [0 ]?.name : null
29+ }
2330 </script >
2431
2532<template >
@@ -32,11 +39,11 @@ const showOriginSite = computed(() =>
3239 <template #default =" { item , older , newer , active } " >
3340 <template v-if =" virtualScroller " >
3441 <DynamicScrollerItem :item =" item" :active =" active" tag =" article" >
35- <StatusCard :status =" item" :context =" context" :older =" older" :newer =" newer" />
42+ <StatusCard :followed-tag = " getFollowedTag(item) " : status =" item" :context =" context" :older =" older" :newer =" newer" />
3643 </DynamicScrollerItem >
3744 </template >
3845 <template v-else >
39- <StatusCard :status =" item" :context =" context" :older =" older" :newer =" newer" />
46+ <StatusCard :followed-tag = " getFollowedTag(item) " : status =" item" :context =" context" :older =" older" :newer =" newer" />
4047 </template >
4148 </template >
4249 <template v-if =" context === ' account' " #done =" { items } " >
0 commit comments