diff options
| author | Kalle Lindström <karl.lindstrom@mullvad.net> | 2024-11-07 16:38:19 +0100 |
|---|---|---|
| committer | David Göransson <david.goransson@mullvad.net> | 2024-11-12 14:33:04 +0100 |
| commit | 456a0bb7eab8920b5eda5440fdc68f598e390dcd (patch) | |
| tree | 69eb0ba8f2b2ba06d5547a668ecd3c166af6eddc /android/service/src | |
| parent | eb88e35d7b3c94ad95d4fac23f85e3400d0654bb (diff) | |
| download | mullvadvpn-456a0bb7eab8920b5eda5440fdc68f598e390dcd.tar.xz mullvadvpn-456a0bb7eab8920b5eda5440fdc68f598e390dcd.zip | |
Fix account expiry in app notif not resetting
Diffstat (limited to 'android/service/src')
| -rw-r--r-- | android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryTickerFlow.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryTickerFlow.kt b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryTickerFlow.kt index c3a444f5ed..3683096c80 100644 --- a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryTickerFlow.kt +++ b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/notifications/accountexpiry/AccountExpiryTickerFlow.kt @@ -10,7 +10,7 @@ fun expiryTickerFlow( expiry: DateTime, tickStart: Duration, updateInterval: (expiry: DateTime) -> Duration, -): Flow<Duration> = flow { +): Flow<Duration?> = flow { expiry.millisFromNow().let { expiryMillis -> if (expiryMillis <= 0) { // Has expired. @@ -18,6 +18,8 @@ fun expiryTickerFlow( return@flow } if (expiryMillis > tickStart.millis) { + // Emit null if no expiry notification should be provided. + emit(null) // Delay until the time we should start emitting. delay(expiryMillis - tickStart.millis + 1) } |
