Change the distributor in dialog cancellation only if there is no existing one

This commit is contained in:
Maxime NATUREL 2022-11-30 11:06:24 +01:00
parent 3f944e9d36
commit 95556d2551

View File

@ -206,8 +206,11 @@ class UnifiedPushHelper @Inject constructor(
onDistributorSelected(distributor) onDistributorSelected(distributor)
} }
.setOnCancelListener { .setOnCancelListener {
// By default, use internal solution (fcm/background sync) // we do not want to change the distributor on behalf of the user
onDistributorSelected(context.packageName) if (UnifiedPush.getDistributor(context).isEmpty()) {
// By default, use internal solution (fcm/background sync)
onDistributorSelected(context.packageName)
}
} }
.setCancelable(true) .setCancelable(true)
.show() .show()