From 12d65d78d6d3c236446fb12bb0a6bdd29e6dc35f Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 7 Feb 2024 16:54:01 -0300 Subject: [PATCH] [FIX] add missing ScanFinished event --- .../src/lib/pushnotificationsservice.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/bitcore-wallet-service/src/lib/pushnotificationsservice.ts b/packages/bitcore-wallet-service/src/lib/pushnotificationsservice.ts index 18948e85a0a..7078cd44c18 100644 --- a/packages/bitcore-wallet-service/src/lib/pushnotificationsservice.ts +++ b/packages/bitcore-wallet-service/src/lib/pushnotificationsservice.ts @@ -44,6 +44,10 @@ const PUSHNOTIFICATIONS_TYPES = { NewAddress: { dataOnly: true }, + ScanFinished: { + dataOnly: true, + broadcastToActiveUsers: true + }, NewBlock: { dataOnly: true, broadcastToActiveUsers: true @@ -613,10 +617,13 @@ export class PushNotificationsService { // if copayerid is associated to externalUserId use Braze subscriptions // avoid multiple notifications const allSubs = allSubsWithExternalId.length > 0 ? allSubsWithExternalId : allSubsWithToken; + const chainOrCoin = notification.data.chain || notification.data.coin; + const networkInfo = notification.data.network; + const hasChainNetworkInfo = chainOrCoin && networkInfo; + const chainNetworkMessage = hasChainNetworkInfo ? ` [${chainOrCoin}/${networkInfo}]` : ''; + logger.info( - `Sending ${notification.type} [${notification.data.chain || notification.data.coin}/${ - notification.data.network - }] notifications to: ${allSubs.length} devices` + `Sending ${notification.type}${chainNetworkMessage} notifications to: ${allSubs.length} devices` ); return cb(null, allSubs); });