Ignore if no change is done.

This commit is contained in:
Benoit Marty 2022-06-02 14:32:23 +02:00 committed by Benoit Marty
parent 420144dceb
commit fb7df5bf46

View file

@ -152,11 +152,16 @@ class UnifiedPushHelper @Inject constructor(
MaterialAlertDialogBuilder(activity)
.setTitle(stringProvider.getString(R.string.unifiedpush_getdistributors_dialog_title))
.setItems(distributorsName.toTypedArray()) { _, which ->
val distributor = distributors[which]
if (distributor == getCurrentDistributorName()) {
Timber.d("Same distributor selected again, no action")
return@setItems
}
if (unregisterFirst) {
// Un-register first
unregister(pushersManager)
}
val distributor = distributors[which]
up.saveDistributor(context, distributor)
Timber.i("Saving distributor: $distributor")
up.registerApp(context)