diff --git a/app/src/main/java/com/sopt/withsuhyeon/feature/chat/ChatScreen.kt b/app/src/main/java/com/sopt/withsuhyeon/feature/chat/ChatScreen.kt index 90c39b3..e718947 100644 --- a/app/src/main/java/com/sopt/withsuhyeon/feature/chat/ChatScreen.kt +++ b/app/src/main/java/com/sopt/withsuhyeon/feature/chat/ChatScreen.kt @@ -19,7 +19,6 @@ import androidx.hilt.navigation.compose.hiltViewModel import com.sopt.withsuhyeon.R import com.sopt.withsuhyeon.core.component.list.TotalChatRoomList import com.sopt.withsuhyeon.core.component.topbar.MainTopNavBar -import com.sopt.withsuhyeon.domain.entity.ChatRoomModel import com.sopt.withsuhyeon.ui.theme.WithSuhyeonTheme.colors @Composable diff --git a/app/src/main/java/com/sopt/withsuhyeon/feature/chat/ChatViewModel.kt b/app/src/main/java/com/sopt/withsuhyeon/feature/chat/ChatViewModel.kt index c952028..caecd3e 100644 --- a/app/src/main/java/com/sopt/withsuhyeon/feature/chat/ChatViewModel.kt +++ b/app/src/main/java/com/sopt/withsuhyeon/feature/chat/ChatViewModel.kt @@ -5,17 +5,15 @@ import com.sopt.withsuhyeon.domain.entity.ChatRoomModel import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow import javax.inject.Inject @HiltViewModel class ChatViewModel @Inject constructor( ) : ViewModel() { - private val _chatRooms = MutableStateFlow>(emptyList()) - val chatRooms: StateFlow> get() = _chatRooms - - init { - _chatRooms.value = listOf( + private val _chatRooms = MutableStateFlow( + listOf( ChatRoomModel( profileImage = "https://via.placeholder.com/150", partnerName = "작심이 친구", @@ -87,5 +85,6 @@ class ChatViewModel @Inject constructor( unreadChatCount = "98" ), ) - } + ) + val chatRooms: StateFlow> = _chatRooms.asStateFlow() } \ No newline at end of file