mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Fix bug, was not looking at the current PushProvider.
This commit is contained in:
committed by
Benoit Marty
parent
b63aa07b59
commit
ff61eaa6a7
+3
-2
@@ -61,10 +61,11 @@ class DefaultPushService @Inject constructor(
|
|||||||
): Result<Unit> {
|
): Result<Unit> {
|
||||||
val userPushStore = userPushStoreFactory.getOrCreate(matrixClient.sessionId)
|
val userPushStore = userPushStoreFactory.getOrCreate(matrixClient.sessionId)
|
||||||
val currentPushProviderName = userPushStore.getPushProviderName()
|
val currentPushProviderName = userPushStore.getPushProviderName()
|
||||||
val currentDistributorValue = pushProvider.getCurrentDistributor(matrixClient)?.value
|
val currentPushProvider = pushProviders.find { it.name == currentPushProviderName }
|
||||||
|
val currentDistributorValue = currentPushProvider?.getCurrentDistributor(matrixClient)?.value
|
||||||
if (currentPushProviderName != pushProvider.name || currentDistributorValue != distributor.value) {
|
if (currentPushProviderName != pushProvider.name || currentDistributorValue != distributor.value) {
|
||||||
// Unregister previous one if any
|
// Unregister previous one if any
|
||||||
pushProviders.find { it.name == currentPushProviderName }?.unregister(matrixClient)
|
currentPushProvider?.unregister(matrixClient)
|
||||||
?.onFailure {
|
?.onFailure {
|
||||||
Timber.w(it, "Failed to unregister previous push provider")
|
Timber.w(it, "Failed to unregister previous push provider")
|
||||||
return Result.failure(it)
|
return Result.failure(it)
|
||||||
|
|||||||
Reference in New Issue
Block a user