Skip to content

Commit

Permalink
fix: resolve typecheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shuuji3 committed Jan 17, 2025
1 parent 5a4ad5b commit 74ce35e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions components/notification/NotificationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ if (unsupportedEmojiReactionTypes.includes(notification.type) || !supportedNotif
<div flex p4 items-center>
<div i-material-symbols:heart-broken-outline-rounded text-xl me-4 color-red />
<div class="content-rich">
<!--
@vue-ignore
The type inference failed here (any) but `typeof notification === SeveredRelationshipsNotification` here..
So we can assume the existence of `event` prop.
ref. https://docs.joinmastodon.org/entities/Notification/#relationship_severance_event
-->
<RelationshipSeveranceCard :event="notification.event!" />
</div>
</div>
Expand Down
10 changes: 9 additions & 1 deletion components/notification/RelationshipSeveranceCard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
// TODO: masto.js needs to update those two props modified in Mastodon v4.3+
// ref. RelationshipSeveranceEvent - Mastodon documentation
// - https://docs.joinmastodon.org/entities/RelationshipSeveranceEvent/
const { event } = defineProps<{
event: object
event: mastodon.v1.RelationshipSeveranceEvent & {
followersCount?: number | null
followingCount?: number | null
}
}>()
const { t } = useI18n()
Expand Down

0 comments on commit 74ce35e

Please sign in to comment.