Skip to content

Commit 5aa2b31

Browse files
committed
fix: resolve typecheck errors
1 parent 5a4ad5b commit 5aa2b31

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

components/notification/NotificationCard.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ if (unsupportedEmojiReactionTypes.includes(notification.type) || !supportedNotif
141141
<div flex p4 items-center>
142142
<div i-material-symbols:heart-broken-outline-rounded text-xl me-4 color-red />
143143
<div class="content-rich">
144+
<!--
145+
@vue-ignore
146+
The type inference failed here (`any`) but since notification type is `severed_relationships`,
147+
we are sure `typeof notification === SeveredRelationshipsNotification` here.
148+
So we can assume the existence of `event` prop.
149+
ref. https://docs.joinmastodon.org/entities/Notification/#relationship_severance_event
150+
-->
144151
<RelationshipSeveranceCard :event="notification.event!" />
145152
</div>
146153
</div>

components/notification/RelationshipSeveranceCard.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<script setup lang="ts">
2+
import type { mastodon } from 'masto'
3+
4+
// TODO: masto.js needs to update those two props modified in Mastodon v4.3+
5+
// ref. RelationshipSeveranceEvent - Mastodon documentation
6+
// - https://docs.joinmastodon.org/entities/RelationshipSeveranceEvent/
27
const { event } = defineProps<{
3-
event: object
8+
event: mastodon.v1.RelationshipSeveranceEvent & {
9+
followersCount?: number | null
10+
followingCount?: number | null
11+
}
412
}>()
513
614
const { t } = useI18n()

0 commit comments

Comments
 (0)