From e7ccd00ad33c91e89162e47c10934f0cd144b713 Mon Sep 17 00:00:00 2001 From: rshigg <90143161+rshigg@users.noreply.github.com> Date: Sun, 15 Jan 2023 06:30:39 -0330 Subject: [PATCH] fix: Improve styling and add accessible text to notify button (#1138) --- components/account/AccountHeader.vue | 26 +++++++++++++++----------- locales/en-US.json | 1 + 2 files changed, 16 insertions(+), 11 deletions(-) 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)