diff --git a/AOS/app/src/main/java/boostcamp/and07/mindsync/ui/main/MainViewModel.kt b/AOS/app/src/main/java/boostcamp/and07/mindsync/ui/main/MainViewModel.kt index 3990c56e..93611de8 100644 --- a/AOS/app/src/main/java/boostcamp/and07/mindsync/ui/main/MainViewModel.kt +++ b/AOS/app/src/main/java/boostcamp/and07/mindsync/ui/main/MainViewModel.kt @@ -50,13 +50,14 @@ class MainViewModel fun getSpaces() { viewModelScope.launch(coroutineExceptionHandler) { profileSpaceRepository.getSpaces().collectLatest { responseSpaces -> - val newSpaces = responseSpaces.map { space -> - if (space.id == _uiState.value.nowSpace?.id) { - space.copy(isSelected = true) - } else { - space + val newSpaces = + responseSpaces.map { space -> + if (space.id == _uiState.value.nowSpace?.id) { + space.copy(isSelected = true) + } else { + space + } } - } _uiState.update { uiState -> uiState.copy( spaces = newSpaces,