diff --git a/app/src/main/java/org/android/go/sopt/data/source/RepoDataSource.kt b/app/src/main/java/org/android/go/sopt/data/source/RepoDataSource.kt index 5156ff4..0da411f 100644 --- a/app/src/main/java/org/android/go/sopt/data/source/RepoDataSource.kt +++ b/app/src/main/java/org/android/go/sopt/data/source/RepoDataSource.kt @@ -10,8 +10,12 @@ class RepoDataSource @Inject constructor( private val assetLoader: AssetLoader, ) { fun getRepoList(): Array { - return assetLoader.getJsonString("fake_repo_list.json")?.let { jsonString -> + return assetLoader.getJsonString(FILE_FAKE_REPO_LIST)?.let { jsonString -> Json.decodeFromString>(jsonString) } ?: emptyArray() } + + companion object { + private const val FILE_FAKE_REPO_LIST = "fake_repo_list.json" + } } diff --git a/app/src/main/java/org/android/go/sopt/presentation/main/home/HomeViewModel.kt b/app/src/main/java/org/android/go/sopt/presentation/main/home/HomeViewModel.kt index 8fa06a6..20f2dbc 100644 --- a/app/src/main/java/org/android/go/sopt/presentation/main/home/HomeViewModel.kt +++ b/app/src/main/java/org/android/go/sopt/presentation/main/home/HomeViewModel.kt @@ -40,8 +40,8 @@ class HomeViewModel @Inject constructor( Timber.d("GET REPO LIST SUCCESS : $repoList") } .onFailure { t -> - Timber.e("GET REPO LIST FAIL : ${t.message}") _getRepoListState.value = Failure(null) + Timber.e("GET REPO LIST FAIL : ${t.message}") } } }