summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkNotification.vue
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2025-05-17 12:59:52 +0100
committerdakkar <dakkar@thenautilus.net>2025-05-25 12:35:13 +0100
commit9c89c91ded2c0ff577c82463eed3c41ee766584a (patch)
treed560064705b1a31ea4bcff7db5d0c831a6f7fcf2 /packages/frontend/src/components/MkNotification.vue
parentmerge: make DynamicNote less dynamic - helps with #1059 (!1041) (diff)
downloadsharkey-9c89c91ded2c0ff577c82463eed3c41ee766584a.tar.gz
sharkey-9c89c91ded2c0ff577c82463eed3c41ee766584a.tar.bz2
sharkey-9c89c91ded2c0ff577c82463eed3c41ee766584a.zip
handle "follow" notifs from deleted user
the backend should not send these, but still, let's not explode
Diffstat (limited to 'packages/frontend/src/components/MkNotification.vue')
-rw-r--r--packages/frontend/src/components/MkNotification.vue17
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue
index 5b2a8dfc5a..220ca04d47 100644
--- a/packages/frontend/src/components/MkNotification.vue
+++ b/packages/frontend/src/components/MkNotification.vue
@@ -242,13 +242,18 @@ watch(props, async () => {
const type = props.notification.type;
// To avoid extra lookups, only do the query when it actually matters.
- if (type === 'follow' || type === 'receiveFollowRequest') {
- const user = await misskeyApi('users/show', {
- userId: props.notification.userId,
- });
+ if ((type === 'follow' || type === 'receiveFollowRequest') && props.notification.userId) {
+ try {
+ const user = await misskeyApi('users/show', {
+ userId: props.notification.userId,
+ });
- userDetailed.value = user;
- followRequestDone.value = !user.hasPendingFollowRequestToYou;
+ userDetailed.value = user;
+ followRequestDone.value = !user.hasPendingFollowRequestToYou;
+ } catch {
+ userDetailed.value = null;
+ followRequestDone.value = false;
+ }
} else {
userDetailed.value = null;
followRequestDone.value = false;