Skip to content

Commit 9c73981

Browse files
committed
Use default gateway on error if no gateway is recorded yet
1 parent 241fcb0 commit 9c73981

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libraries/pushproviders/unifiedpush/src/main/kotlin/io/element/android/libraries/pushproviders/unifiedpush/UnifiedPushGatewayUrlResolver.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ class DefaultUnifiedPushGatewayUrlResolver(
2828
): String {
2929
return when (gatewayResult) {
3030
is UnifiedPushGatewayResolverResult.Error -> {
31-
// Use previous gateway if any, or the provided one
32-
unifiedPushStore.getPushGateway(instance) ?: gatewayResult.gateway
31+
// Use previous gateway if any, or the default one
32+
unifiedPushStore.getPushGateway(instance)
33+
?: defaultPushGatewayHttpUrlProvider.provide()
3334
}
3435
UnifiedPushGatewayResolverResult.ErrorInvalidUrl,
3536
UnifiedPushGatewayResolverResult.NoMatrixGateway -> {

0 commit comments

Comments
 (0)