Skip to content

Commit

Permalink
[in-app-broadcast] Add support for unlimited frequency (#12779)
Browse files Browse the repository at this point in the history
  • Loading branch information
karngyan authored Oct 18, 2024
2 parents a911e30 + d73374d commit 7831bb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/managers/message-broadcast-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export async function getEligibleBroadcasts() {
const { broadcast: broadcastDetails } = broadcast.properties.gist;
const shouldShow = getKeyFromLocalStore(getBroadcastShouldShowLocalStoreName(messageBroadcastLocalStoreName, broadcast.queueId)) ?? true;
const numberOfTimesShown = getKeyFromLocalStore(getNumberOfTimesShownLocalStoreName(messageBroadcastLocalStoreName, broadcast.queueId)) || 0;
return shouldShow && numberOfTimesShown < broadcastDetails.frequency.count;
const isFrequencyUnlimited = broadcastDetails.frequency.count === 0;
return shouldShow && (isFrequencyUnlimited || numberOfTimesShown < broadcastDetails.frequency.count);
});
}

Expand Down

0 comments on commit 7831bb7

Please sign in to comment.