From 95556d25515d08b6f9fcc8154be65908110f17ef Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Wed, 30 Nov 2022 11:06:24 +0100 Subject: [PATCH] Change the distributor in dialog cancellation only if there is no existing one --- .../java/im/vector/app/core/pushers/UnifiedPushHelper.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt b/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt index 34ba254250..87231d1d67 100644 --- a/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt +++ b/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt @@ -206,8 +206,11 @@ class UnifiedPushHelper @Inject constructor( onDistributorSelected(distributor) } .setOnCancelListener { - // By default, use internal solution (fcm/background sync) - onDistributorSelected(context.packageName) + // we do not want to change the distributor on behalf of the user + if (UnifiedPush.getDistributor(context).isEmpty()) { + // By default, use internal solution (fcm/background sync) + onDistributorSelected(context.packageName) + } } .setCancelable(true) .show()