For coreexample we do not want to support by default the api connection fallback, so the provider is set to null.

This commit is contained in:
dkadrikj 2021-11-24 10:38:25 +01:00 committed by Dino Kadrikj
parent d2da1c1014
commit 75024be4bb
2 changed files with 3 additions and 12 deletions

View File

@ -29,7 +29,7 @@ plugins {
}
android(
version = Version(1, 18, 3),
version = Version(1, 18, 4),
useViewBinding = true
)
{

View File

@ -109,7 +109,7 @@ class NetworkModule {
humanVerificationProvider: HumanVerificationProvider,
humanVerificationListener: HumanVerificationListener,
extraHeaderProvider: ExtraHeaderProvider,
apiConnectionListener: ApiConnectionListener
apiConnectionListener: ApiConnectionListener? = null
): ApiManagerFactory = ApiManagerFactory(
Constants.BASE_URL,
apiClient,
@ -141,16 +141,7 @@ class NetworkModule {
@Provides
@Singleton
fun provideGuestHoleFallbackListener(): ApiConnectionListener = object: ApiConnectionListener {
override suspend fun <T> onPotentiallyBlocked(
path: String?,
query: String?,
backendCall: suspend () -> ApiResult<T>
): ApiResult<T>? {
delay(1000)
return backendCall()
}
}
fun provideApiConnectionListener(): ApiConnectionListener? = null
}
@Module