summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2022-12-14 15:19:18 +0100
committerAlbin <albin@mullvad.net>2022-12-14 15:19:20 +0100
commit49c5a0d58133053461a8938744ecfe1941564760 (patch)
treee699230169557ec7215281031f6b9edc10396117 /android
parent7a591dc4d8f688c2342be8cddf19306f23e51e88 (diff)
downloadmullvadvpn-49c5a0d58133053461a8938744ecfe1941564760.tar.xz
mullvadvpn-49c5a0d58133053461a8938744ecfe1941564760.zip
Fix incorrect in-app notification showing
This commit fixes an issue where the incorrect notification was showing due to the amount of notification changes.
Diffstat (limited to 'android')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt
index aada1847a9..1c0fb73d93 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/InAppNotificationController.kt
@@ -45,8 +45,10 @@ class InAppNotificationController(private val onNotificationChanged: (InAppNotif
}
fun notificationChanged(notification: InAppNotification) {
- if (notification.shouldShow && !activeNotifications.contains(notification)) {
- activeNotifications.add(notification)
+ if (notification.shouldShow) {
+ if (activeNotifications.contains(notification).not()) {
+ activeNotifications.add(notification)
+ }
} else {
activeNotifications.remove(notification)
}