Refactor: Delegate notification store updates to calling components after API responses.

This commit is contained in:
pa
2026-03-04 21:48:28 +09:00
parent c522ab21f1
commit 905999b9ae
5 changed files with 116 additions and 128 deletions

View File

@@ -1303,6 +1303,7 @@
useLocationStore,
useModalStore,
useModerationStore,
useNotificationStore,
useUiStore,
useUserStore,
useWorldStore
@@ -1971,9 +1972,18 @@
});
handleSendFriendRequest(args);
} else {
notificationRequest.acceptFriendRequestNotification({
notificationId: key
});
notificationRequest
.acceptFriendRequestNotification({
notificationId: key
})
.then((args) => {
useNotificationStore().handleNotificationAccept(args);
})
.catch((err) => {
if (err && err.message && err.message.includes('404')) {
useNotificationStore().handleNotificationHide(key);
}
});
}
break;
case 'Decline Friend Request':
@@ -1984,9 +1994,13 @@
});
handleCancelFriendRequest(args);
} else {
notificationRequest.hideNotification({
notificationId: key
});
notificationRequest
.hideNotification({
notificationId: key
})
.then(() => {
useNotificationStore().handleNotificationHide(key);
});
}
break;
case 'Cancel Friend Request': {