Skip to content

Commit

Permalink
[FIX] add missing ScanFinished event
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbazan7 committed Feb 7, 2024
1 parent f9a3b64 commit 12d65d7
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ const PUSHNOTIFICATIONS_TYPES = {
NewAddress: {
dataOnly: true
},
ScanFinished: {
dataOnly: true,
broadcastToActiveUsers: true
},
NewBlock: {
dataOnly: true,
broadcastToActiveUsers: true
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 12d65d7

Please sign in to comment.