change chat list
This commit is contained in:
parent
0359616c8f
commit
aa4b871c41
@ -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,6 +106,12 @@ struct ChatsTab: View {
|
|||||||
globalSearchContent
|
globalSearchContent
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if let message = viewModel.errorMessage, viewModel.chats.isEmpty {
|
||||||
|
errorState(message: message)
|
||||||
|
} else if viewModel.chats.isEmpty {
|
||||||
|
emptyState
|
||||||
|
} else {
|
||||||
|
|
||||||
ForEach(viewModel.chats) { chat in
|
ForEach(viewModel.chats) { chat in
|
||||||
chatRowItem(for: chat)
|
chatRowItem(for: chat)
|
||||||
}
|
}
|
||||||
@ -119,6 +121,7 @@ struct ChatsTab: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.listStyle(.plain)
|
.listStyle(.plain)
|
||||||
.modifier(ScrollDismissesKeyboardModifier())
|
.modifier(ScrollDismissesKeyboardModifier())
|
||||||
.simultaneousGesture(searchBarGesture)
|
.simultaneousGesture(searchBarGesture)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user