feat: show notification timestamp (#3215)

This commit is contained in:
TAKAHASHI Shuuji 2025-03-03 01:54:35 +09:00 committed by GitHub
parent 41379627b5
commit d94b14ae53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 8 deletions

View file

@ -8,6 +8,10 @@ const useStarFavoriteIcon = usePreferences('useStarFavoriteIcon')
const reblogs = computed(() => group.likes.filter(i => i.reblog))
const likes = computed(() => group.likes.filter(i => i.favourite && !i.reblog))
const timeAgoOptions = useTimeAgoOptions(true)
const reblogsTimeAgo = useTimeAgo(() => reblogs.value[0].reblog?.createdAt ?? '', timeAgoOptions)
const likesTimeAgo = useTimeAgo(() => likes.value[0].favourite?.createdAt ?? '', timeAgoOptions)
</script>
<template>
@ -24,7 +28,7 @@ const likes = computed(() => group.likes.filter(i => i.favourite && !i.reblog))
</AccountHoverWrapper>
</template>
<div ml1>
{{ $t('notification.reblogged_post') }}
{{ $t('notification.reblogged_post') }}{{ reblogsTimeAgo }}
</div>
</div>
<div v-if="likes.length" flex="~ gap-1 wrap">
@ -37,7 +41,7 @@ const likes = computed(() => group.likes.filter(i => i.favourite && !i.reblog))
</AccountHoverWrapper>
</template>
<div ms-4>
{{ $t('notification.favourited_post') }}
{{ $t('notification.favourited_post') }} {{ likesTimeAgo }}
</div>
</div>
</div>