mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
Bug 1822899 - Limit Nimbus message display count to max display count
This commit is contained in:
parent
b1ad36df71
commit
126591afd6
@ -78,7 +78,7 @@ class NimbusMessagingStorage(
|
|||||||
?: return@mapNotNull null,
|
?: return@mapNotNull null,
|
||||||
)
|
)
|
||||||
}.filter {
|
}.filter {
|
||||||
it.maxDisplayCount >= it.metadata.displayCount &&
|
!it.isExpired &&
|
||||||
!it.metadata.dismissed &&
|
!it.metadata.dismissed &&
|
||||||
!it.metadata.pressed
|
!it.metadata.pressed
|
||||||
}.sortedByDescending {
|
}.sortedByDescending {
|
||||||
|
@ -193,12 +193,19 @@ class NimbusMessagingStorageTest {
|
|||||||
id = "shown-many-times-message",
|
id = "shown-many-times-message",
|
||||||
displayCount = 10,
|
displayCount = 10,
|
||||||
),
|
),
|
||||||
|
"shown-two-times-message" to Message.Metadata(
|
||||||
|
id = "shown-two-times-message",
|
||||||
|
displayCount = 2,
|
||||||
|
),
|
||||||
"normal-message" to Message.Metadata(id = "normal-message", displayCount = 0),
|
"normal-message" to Message.Metadata(id = "normal-message", displayCount = 0),
|
||||||
)
|
)
|
||||||
val messages = mapOf(
|
val messages = mapOf(
|
||||||
"shown-many-times-message" to createMessageData(
|
"shown-many-times-message" to createMessageData(
|
||||||
style = "high-priority",
|
style = "high-priority",
|
||||||
),
|
),
|
||||||
|
"shown-two-times-message" to createMessageData(
|
||||||
|
style = "high-priority",
|
||||||
|
),
|
||||||
"normal-message" to createMessageData(style = "high-priority"),
|
"normal-message" to createMessageData(style = "high-priority"),
|
||||||
)
|
)
|
||||||
val styles = mapOf(
|
val styles = mapOf(
|
||||||
|
Loading…
Reference in New Issue
Block a user