Lazy use the OkHttpClient.

This commit is contained in:
Benoit Marty
2023-06-07 09:06:46 +02:00
parent 6b264a6397
commit ee1571590f

View File

@@ -32,6 +32,6 @@ class RetrofitFactory @Inject constructor(
fun create(baseUrl: String): Retrofit = Retrofit.Builder()
.baseUrl(baseUrl.ensureTrailingSlash())
.addConverterFactory(json.get().asConverterFactory("application/json".toMediaType()))
.callFactory(okHttpClient.get())
.callFactory { request -> okHttpClient.get().newCall(request) }
.build()
}