Skip to content

Commit

Permalink
[mod] #338 shared pref에 저장된 값에 따라 서버 모드 변경하는 코드 복구
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeha committed Mar 21, 2024
1 parent be11c32 commit 4fa182a
Showing 1 changed file with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,19 @@ class ApplicationClass : Application() {
const val API_MODE = "API_MODE"

fun getBaseUrl(): String {
return BuildConfig.RUNNECT_PROD_URL

// return when {
// !BuildConfig.DEBUG -> BuildConfig.RUNNECT_PROD_URL
// !::appContext.isInitialized -> BuildConfig.RUNNECT_PROD_URL
// else -> {
// val mode = ApiMode.getCurrentApiMode(appContext)
// when (mode) {
// ApiMode.JAVA -> BuildConfig.RUNNECT_PROD_URL
// ApiMode.TEST -> BuildConfig.RUNNECT_DEV_URL
// else -> BuildConfig.RUNNECT_NODE_URL
// }
// }
// }
return when {
!BuildConfig.DEBUG -> BuildConfig.RUNNECT_PROD_URL
!::appContext.isInitialized -> BuildConfig.RUNNECT_PROD_URL
else -> {
val mode = ApiMode.getCurrentApiMode(appContext)
Timber.d("현재 서버: ${mode}")
when (mode) {
ApiMode.JAVA -> BuildConfig.RUNNECT_PROD_URL
ApiMode.TEST -> BuildConfig.RUNNECT_DEV_URL
else -> BuildConfig.RUNNECT_NODE_URL
}
}
}
}
}
}

0 comments on commit 4fa182a

Please sign in to comment.