From fc66e5f120b7acdd773a14d1888260221f4c1367 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 2 Jun 2022 15:01:17 +0200 Subject: [PATCH] Ignore if no change is done - bugfix --- .../java/im/vector/app/core/pushers/UnifiedPushHelper.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 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 e975f4cf57..53f2045249 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 @@ -156,7 +156,7 @@ class UnifiedPushHelper @Inject constructor( .setTitle(stringProvider.getString(R.string.unifiedpush_getdistributors_dialog_title)) .setItems(distributorsName.toTypedArray()) { _, which -> val distributor = distributors[which] - if (distributor == getCurrentDistributorName()) { + if (distributor == up.getDistributor(context)) { Timber.d("Same distributor selected again, no action") return@setItems } @@ -169,12 +169,10 @@ class UnifiedPushHelper @Inject constructor( up.saveDistributor(context, distributor) Timber.i("Saving distributor: $distributor") up.registerApp(context) + onDoneRunnable?.run() } } .setCancelable(cancellable) - .setOnDismissListener { - onDoneRunnable?.run() - } .show() }