From 3d6df8b231bca47226c52154e0048c65b0f67cb4 Mon Sep 17 00:00:00 2001 From: Kgothatso Ngako Date: Sun, 12 Jul 2026 17:24:58 +0200 Subject: [PATCH] Bug fix for renaming --- .../ChatRoomDetailMessageListViewModel.kt | 20 +++++++++---------- .../state/ChatRoomDetailMessageListUIState.kt | 11 ---------- .../view/state/ChatRoomMessageListUIState.kt | 11 ++++++++++ 3 files changed, 21 insertions(+), 21 deletions(-) delete mode 100755 composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/state/ChatRoomDetailMessageListUIState.kt create mode 100755 composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/state/ChatRoomMessageListUIState.kt diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomDetailMessageListViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomDetailMessageListViewModel.kt index 1cdaf02c..fd96cb91 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomDetailMessageListViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomDetailMessageListViewModel.kt @@ -50,7 +50,7 @@ import at.torch.compose.nostr.Relays import at.torch.compose.repository.ChatRepository import at.torch.compose.repository.NostrRepository import at.torch.compose.ui.composable.widgets.profile.ProfileColor -import at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState +import at.torch.compose.ui.view.state.ChatRoomMessageListUIState import co.touchlab.kermit.Logger import com.vitorpamplona.quartz.marmot.mip03GroupMessages.GroupEvent import com.vitorpamplona.quartz.nip17Dm.settings.ChatMessageRelayListEvent @@ -61,13 +61,13 @@ import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.launch class ChatRoomDetailMessageListViewModel( - initialChatRoomDetailMessageListUIState: ChatRoomDetailMessageListUIState, + initialChatRoomMessageListUIState: ChatRoomMessageListUIState, val localChatRoom: LocalChatRoom, val nostrRepository: NostrRepository, val chatRepository: ChatRepository ): ViewModel() { val logger = Logger.withTag(TAG) - var chatRoomDetailMessageListUIState: ChatRoomDetailMessageListUIState by mutableStateOf(initialChatRoomDetailMessageListUIState) + var chatRoomMessageListUIState: ChatRoomMessageListUIState by mutableStateOf(initialChatRoomMessageListUIState) private set val isReceiverChatMessageRelayListMissing: MutableState = mutableStateOf(false) @@ -85,7 +85,7 @@ class ChatRoomDetailMessageListViewModel( localChatRoom.chatRoom.id ).distinctUntilChanged().collect { chatMessages -> logger.d("getChatMessageListByChatRoomId: $chatMessages") - chatRoomDetailMessageListUIState = ChatRoomDetailMessageListUIState.Loaded( + chatRoomMessageListUIState = ChatRoomMessageListUIState.Loaded( chatMessageList = chatMessages ) } @@ -203,8 +203,8 @@ class ChatRoomDetailMessageListViewModel( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally ) { - when (val chatRoomDetailMessageListUIState = this@ChatRoomDetailMessageListViewModel.chatRoomDetailMessageListUIState) { - ChatRoomDetailMessageListUIState.Error -> { + when (val chatRoomDetailMessageListUIState = this@ChatRoomDetailMessageListViewModel.chatRoomMessageListUIState) { + ChatRoomMessageListUIState.Error -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -217,7 +217,7 @@ class ChatRoomDetailMessageListViewModel( ) } } - is ChatRoomDetailMessageListUIState.Loaded -> { + is ChatRoomMessageListUIState.Loaded -> { Spacer( modifier = Modifier.weight(1f) ) @@ -385,7 +385,7 @@ class ChatRoomDetailMessageListViewModel( } } } - ChatRoomDetailMessageListUIState.Loading -> { + ChatRoomMessageListUIState.Loading -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -427,14 +427,14 @@ class ChatRoomDetailMessageListViewModel( const val TAG = "ChatRoomDetailMessageListViewModel" fun factory( - initialChatRoomDetailMessageListUIState: ChatRoomDetailMessageListUIState = ChatRoomDetailMessageListUIState.Loading, + initialChatRoomMessageListUIState: ChatRoomMessageListUIState = ChatRoomMessageListUIState.Loading, localChatRoom: LocalChatRoom, nostrRepository: NostrRepository, chatRepository: ChatRepository ): ViewModelProvider.Factory = viewModelFactory { initializer { ChatRoomDetailMessageListViewModel( - initialChatRoomDetailMessageListUIState = initialChatRoomDetailMessageListUIState, + initialChatRoomMessageListUIState = initialChatRoomMessageListUIState, localChatRoom = localChatRoom, nostrRepository = nostrRepository, chatRepository = chatRepository diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/state/ChatRoomDetailMessageListUIState.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/state/ChatRoomDetailMessageListUIState.kt deleted file mode 100755 index 5cc6c344..00000000 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/state/ChatRoomDetailMessageListUIState.kt +++ /dev/null @@ -1,11 +0,0 @@ -package at.torch.compose.ui.view.state - -sealed interface ChatRoomDetailMessageListUIState { - data class Loaded( - val chatMessageList: List - ): ChatRoomDetailMessageListUIState - - data object Error: ChatRoomDetailMessageListUIState - data object Loading: ChatRoomDetailMessageListUIState -} - diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/state/ChatRoomMessageListUIState.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/state/ChatRoomMessageListUIState.kt new file mode 100755 index 00000000..63f797a2 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/state/ChatRoomMessageListUIState.kt @@ -0,0 +1,11 @@ +package at.torch.compose.ui.view.state + +sealed interface ChatRoomMessageListUIState { + data class Loaded( + val chatMessageList: List + ): ChatRoomMessageListUIState + + data object Error: ChatRoomMessageListUIState + data object Loading: ChatRoomMessageListUIState +} +