NTP-1224 | AS | Fix for CommonLibManager.baseUrl null for PaymentNetw… (#11993)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2021-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2021-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -138,4 +138,8 @@ object CommonLibManager {
|
||||
fun getHeaderInterceptorForReact(): Interceptor {
|
||||
return reactHeaderInterceptor
|
||||
}
|
||||
|
||||
fun isBaseUrlInitialized(): Boolean {
|
||||
return this::baseUrl.isInitialized
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ package com.navi.payment.network.di
|
||||
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.navi.base.utils.BaseUtils
|
||||
import com.navi.common.CommonLibManager
|
||||
import com.navi.common.model.ModuleNameV2
|
||||
import com.navi.common.network.converter.EmptyBodyHandlingConverterFactory
|
||||
@@ -134,8 +135,15 @@ object PaymentNetworkModule {
|
||||
* Dynamic Feature module doesn't allow Hilt
|
||||
*/
|
||||
fun getPaymentRetrofitService(): RetrofitService {
|
||||
val updatedBaseUrl =
|
||||
if (CommonLibManager.isBaseUrlInitialized()) {
|
||||
CommonLibManager.baseUrl
|
||||
} else {
|
||||
BaseUtils.getUpdatedBaseUrl()
|
||||
}
|
||||
|
||||
return Retrofit.Builder()
|
||||
.baseUrl(CommonLibManager.baseUrl)
|
||||
.baseUrl(updatedBaseUrl)
|
||||
.addConverterFactory(
|
||||
EmptyBodyHandlingConverterFactory(ModuleNameV2.NAVI_PAYMENT_SCREEN.name)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user