Comment
This commit is contained in:
@@ -50,11 +50,13 @@ export const useConnectionListeners = (account, subscriptions, users, webPushTop
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleNotification = async (subscriptionId, notification) => {
|
const handleNotification = async (subscriptionId, notification) => {
|
||||||
|
// Note: This logic is duplicated in the Android app in SubscriberService::onNotificationReceived()
|
||||||
|
// and FirebaseService::handleMessage().
|
||||||
|
|
||||||
// Delete existing notification with same sid, if any
|
// Delete existing notification with same sid, if any
|
||||||
if (notification.sid) {
|
if (notification.sid) {
|
||||||
await subscriptionManager.deleteNotificationBySid(subscriptionId, notification.sid);
|
await subscriptionManager.deleteNotificationBySid(subscriptionId, notification.sid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add notification to database
|
// Add notification to database
|
||||||
if (!notification.deleted) {
|
if (!notification.deleted) {
|
||||||
const added = await subscriptionManager.addNotification(subscriptionId, notification);
|
const added = await subscriptionManager.addNotification(subscriptionId, notification);
|
||||||
|
|||||||
Reference in New Issue
Block a user