diff --git a/components/account/AccountHeader.vue b/components/account/AccountHeader.vue index 8b307989..aaed93b2 100644 --- a/components/account/AccountHeader.vue +++ b/components/account/AccountHeader.vue @@ -43,15 +43,15 @@ function previewAvatar() { }]) } -async function toggleNotify() { - relationship!.notifying = !relationship!.notifying +async function toggleNotifications() { + relationship!.notifying = !relationship?.notifying try { - const newRel = await client.v1.accounts.follow(account.id, { notify: relationship!.notifying }) + const newRel = await client.v1.accounts.follow(account.id, { notify: relationship?.notifying }) Object.assign(relationship!, newRel) } catch { // TODO error handling - relationship!.notifying = !relationship!.notifying + relationship!.notifying = !relationship?.notifying } } @@ -76,6 +76,7 @@ watchEffect(() => { }) const isSelf = $(useSelfAccount(() => account)) +const isNotifiedOnPost = $computed(() => !!relationship?.notifying)