summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-02-25 18:44:55 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-03-03 16:22:04 +0000
commit233eaf1cb7790108c003eaac307e9f0d3713b70f (patch)
tree87410ae34d239e5ff36294a13523b37bdcbf31f9
parentdcd9071a2bc10348368a487872da4305c932c77a (diff)
downloadmullvadvpn-233eaf1cb7790108c003eaac307e9f0d3713b70f.tar.xz
mullvadvpn-233eaf1cb7790108c003eaac307e9f0d3713b70f.zip
Don't send change event for the same notification
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt
index a67cd7ea45..eaea1a275b 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt
@@ -8,8 +8,10 @@ class InAppNotificationController(private val onNotificationChanged: (InAppNotif
private var currentIndex: Int? = null
- var current by observable<InAppNotification?>(null) { _, _, notification ->
- onNotificationChanged.invoke(notification)
+ var current by observable<InAppNotification?>(null) { _, oldNotification, newNotification ->
+ if (oldNotification != newNotification) {
+ onNotificationChanged.invoke(newNotification)
+ }
}
fun register(notification: InAppNotification) {