Skip to content

Commit 74ce35e

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

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

components/notification/NotificationCard.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ 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 `typeof notification === SeveredRelationshipsNotification` here..
147+
So we can assume the existence of `event` prop.
148+
ref. https://docs.joinmastodon.org/entities/Notification/#relationship_severance_event
149+
-->
144150
<RelationshipSeveranceCard :event="notification.event!" />
145151
</div>
146152
</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)