Skip to content

Commit

Permalink
Merge pull request #2 from calebpollman/conditionally-call-in-app-mes…
Browse files Browse the repository at this point in the history
…sages-handler

fix(in-app-messaging): conditionally call inAppMessagesHandler
  • Loading branch information
cshfang committed Oct 1, 2021
2 parents c49f50f + 85cbf4d commit d4b5a7c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/notifications/src/Notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ class NotificationsClass {
return pluggable.processInAppMessages(messages, event);
})
);
this.inAppMessagesHandler(flatten(messages));

const flattenedMessages = flatten(messages);
if (flattenedMessages.length) {
this.inAppMessagesHandler(flattenedMessages);
}
};

private analyticsListener: HubCallback = ({ payload }: HubCapsule) => {
Expand Down

0 comments on commit d4b5a7c

Please sign in to comment.