Skip to content

Commit 1acd1e3

Browse files
refresh-account deep link updates notifications too.
1 parent 1b5fe2c commit 1acd1e3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/src/main/java/com/protonvpn/android/appconfig/ApiNotificationManager.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class ApiNotificationManager @Inject constructor(
175175
periodicUpdateManager.unregister(notificationsUpdate)
176176
}
177177

178-
private suspend fun forceUpdate() {
178+
suspend fun forceUpdate() {
179179
periodicUpdateManager.executeNow(notificationsUpdate)
180180
}
181181

app/src/main/java/com/protonvpn/android/ui/deeplinks/DeepLinkHandler.kt

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package com.protonvpn.android.ui.deeplinks
2121

2222
import android.net.Uri
23+
import com.protonvpn.android.appconfig.ApiNotificationManager
2324
import com.protonvpn.android.utils.UserPlanManager
2425
import dagger.Reusable
2526
import kotlinx.coroutines.CoroutineScope
@@ -33,6 +34,7 @@ private const val PROTONVPN_SCHEME = "protonvpn"
3334
class DeepLinkHandler @Inject constructor(
3435
private val mainScope: CoroutineScope,
3536
private val userPlanManager: UserPlanManager,
37+
private val notificationManager: ApiNotificationManager,
3638
) {
3739
fun processDeepLink(uri: Uri) {
3840
if (uri.scheme?.equalsNoCase(PROTONVPN_SCHEME) == true) {
@@ -46,6 +48,10 @@ class DeepLinkHandler @Inject constructor(
4648
private fun refreshVpnInfo() {
4749
mainScope.launch {
4850
userPlanManager.refreshVpnInfo()
51+
// Force notifications update even if there is no plan change - the user could be updating between 1m and
52+
// 12m subscriptions.
53+
// This is a temporary solution, we should detect such changes.
54+
notificationManager.forceUpdate()
4955
}
5056
}
5157
}

0 commit comments

Comments
 (0)