mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
handle "follow" notifs from deleted user
the backend should not send these, but still, let's not explode
This commit is contained in:
parent
b6a71d2362
commit
9c89c91ded
1 changed files with 11 additions and 6 deletions
|
@ -242,13 +242,18 @@ watch(props, async () => {
|
||||||
const type = props.notification.type;
|
const type = props.notification.type;
|
||||||
|
|
||||||
// To avoid extra lookups, only do the query when it actually matters.
|
// To avoid extra lookups, only do the query when it actually matters.
|
||||||
if (type === 'follow' || type === 'receiveFollowRequest') {
|
if ((type === 'follow' || type === 'receiveFollowRequest') && props.notification.userId) {
|
||||||
|
try {
|
||||||
const user = await misskeyApi('users/show', {
|
const user = await misskeyApi('users/show', {
|
||||||
userId: props.notification.userId,
|
userId: props.notification.userId,
|
||||||
});
|
});
|
||||||
|
|
||||||
userDetailed.value = user;
|
userDetailed.value = user;
|
||||||
followRequestDone.value = !user.hasPendingFollowRequestToYou;
|
followRequestDone.value = !user.hasPendingFollowRequestToYou;
|
||||||
|
} catch {
|
||||||
|
userDetailed.value = null;
|
||||||
|
followRequestDone.value = false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
userDetailed.value = null;
|
userDetailed.value = null;
|
||||||
followRequestDone.value = false;
|
followRequestDone.value = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue