change chat list

This commit is contained in:
cheykrym 2025-10-08 05:03:46 +03:00
parent 0359616c8f
commit aa4b871c41

View File

@ -56,10 +56,6 @@ struct ChatsTab: View {
private var content: some View { private var content: some View {
if viewModel.isInitialLoading && viewModel.chats.isEmpty { if viewModel.isInitialLoading && viewModel.chats.isEmpty {
loadingState loadingState
} else if let message = viewModel.errorMessage, viewModel.chats.isEmpty {
errorState(message: message)
} else if viewModel.chats.isEmpty {
emptyState
} else { } else {
chatList chatList
} }
@ -110,12 +106,19 @@ struct ChatsTab: View {
globalSearchContent globalSearchContent
} }
} else { } else {
ForEach(viewModel.chats) { chat in if let message = viewModel.errorMessage, viewModel.chats.isEmpty {
chatRowItem(for: chat) errorState(message: message)
} } else if viewModel.chats.isEmpty {
emptyState
} else {
if viewModel.isLoadingMore { ForEach(viewModel.chats) { chat in
loadingMoreRow chatRowItem(for: chat)
}
if viewModel.isLoadingMore {
loadingMoreRow
}
} }
} }
} }