Fix an issue with empty endpoint. It can happen if the endpoint is manually removed from the distributor.
This commit is contained in:
parent
87087197e5
commit
a139756dbc
|
@ -253,7 +253,7 @@ class UnifiedPushHelper @Inject constructor(
|
||||||
|
|
||||||
fun getPrivacyFriendlyUpEndpoint(): String? {
|
fun getPrivacyFriendlyUpEndpoint(): String? {
|
||||||
val endpoint = unifiedPushStore.getEndpointOrToken()
|
val endpoint = unifiedPushStore.getEndpointOrToken()
|
||||||
if (endpoint.isNullOrEmpty()) return endpoint
|
if (endpoint.isNullOrEmpty()) return null
|
||||||
if (isEmbeddedDistributor()) {
|
if (isEmbeddedDistributor()) {
|
||||||
return endpoint
|
return endpoint
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,13 +30,10 @@ class TestUnifiedPushEndpoint @Inject constructor(
|
||||||
|
|
||||||
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
|
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
|
||||||
val endpoint = unifiedPushHelper.getPrivacyFriendlyUpEndpoint()
|
val endpoint = unifiedPushHelper.getPrivacyFriendlyUpEndpoint()
|
||||||
endpoint?.let {
|
if (endpoint != null) {
|
||||||
description = stringProvider.getString(
|
description = stringProvider.getString(R.string.settings_troubleshoot_test_current_endpoint_success, endpoint)
|
||||||
R.string.settings_troubleshoot_test_current_endpoint_success,
|
|
||||||
unifiedPushHelper.getPrivacyFriendlyUpEndpoint()
|
|
||||||
)
|
|
||||||
status = TestStatus.SUCCESS
|
status = TestStatus.SUCCESS
|
||||||
} ?: run {
|
} else {
|
||||||
description = stringProvider.getString(R.string.settings_troubleshoot_test_current_endpoint_failed)
|
description = stringProvider.getString(R.string.settings_troubleshoot_test_current_endpoint_failed)
|
||||||
status = TestStatus.FAILED
|
status = TestStatus.FAILED
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue