diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt index f24da187..0c3951f5 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyScreen.kt @@ -17,6 +17,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme +import com.wap.designsystem.component.CircleLoader import com.wap.designsystem.component.WappLeftMainTopBar import com.wap.wapp.core.commmon.extensions.toSupportingText import com.wap.wapp.core.model.user.UserRole @@ -61,7 +62,9 @@ internal fun SurveyScreen( is SurveyViewModel.UserRoleUiState.Init -> {} is SurveyViewModel.UserRoleUiState.Success -> { when (userRoleUiState.userRole) { - UserRole.GUEST -> { isGuest = true } + UserRole.GUEST -> { + isGuest = true + } // 비회원이 아닌 경우, 목록 호출 UserRole.MEMBER -> viewModel.getSurveyFormList() @@ -95,6 +98,10 @@ internal fun SurveyScreen( ) { paddingValues -> when (surveyFormListUiState) { is SurveyViewModel.SurveyFormListUiState.Init -> {} + + is SurveyViewModel.SurveyFormListUiState.Loading -> + CircleLoader(modifier = Modifier.fillMaxSize()) + is SurveyViewModel.SurveyFormListUiState.Success -> { SurveyContent( surveyFormList = surveyFormListUiState.surveyFormList, diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyViewModel.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyViewModel.kt index 9b63087a..29b0b6bc 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyViewModel.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/SurveyViewModel.kt @@ -47,6 +47,8 @@ class SurveyViewModel @Inject constructor( } fun getSurveyFormList() = viewModelScope.launch { + _surveyFormListUiState.value = SurveyFormListUiState.Loading + getSurveyFormListUseCase() .onSuccess { surveyFormList -> val filteredSurveyFormList = surveyFormList.filter { survey ->