Skip to content

Commit

Permalink
[hotfix] 데일리 루틴 테마 리스트 조회할 때, 기본값을 고정으로 전달해서 테마 리스트가 변동할 경우 순서 안맞는 이슈 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
stellar-halo committed May 3, 2024
1 parent 9ef6e53 commit fa1d776
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ class DailyRoutineAddActivity :
setStatusBarColorFromResource(R.color.background)

dailyRoutineAddViewModel.getThemeList()
dailyRoutineAddViewModel.setThemeId(6)
dailyRoutineAddViewModel.themeList.observe(this){list ->
if(list.isNotEmpty()){
dailyRoutineAddViewModel.setThemeId(list[0].themeId)
}
}
setupAdapter()
setupList()
setIndicator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class DailyRoutineAddViewModel @Inject constructor(

fun getDailyRoutine() {
viewModelScope.launch {
getRoutineDailyThemeListUseCase(themeId.value ?: 6)
getRoutineDailyThemeListUseCase(themeId.value ?: _themeList.value?.get(0)?.themeId ?: 5)
.onSuccess { response ->
_dailyRoutineCardThemeList.value = response
}
Expand Down

0 comments on commit fa1d776

Please sign in to comment.