chat fix
This commit is contained in:
parent
ad0577f1fb
commit
c22545a3b8
@ -18,7 +18,6 @@ struct ChatsTab: View {
|
|||||||
private let chatService = ChatService()
|
private let chatService = ChatService()
|
||||||
@AppStorage("chatRowMessageLineLimit") private var messageLineLimitSetting: Int = 2
|
@AppStorage("chatRowMessageLineLimit") private var messageLineLimitSetting: Int = 2
|
||||||
@StateObject private var viewModel = PrivateChatsViewModel()
|
@StateObject private var viewModel = PrivateChatsViewModel()
|
||||||
@State private var selectedChatId: String?
|
|
||||||
@State private var searchDragStartProgress: CGFloat = 0
|
@State private var searchDragStartProgress: CGFloat = 0
|
||||||
@State private var isSearchGestureActive: Bool = false
|
@State private var isSearchGestureActive: Bool = false
|
||||||
@State private var globalSearchResults: [UserSearchResult] = []
|
@State private var globalSearchResults: [UserSearchResult] = []
|
||||||
@ -447,7 +446,7 @@ struct ChatsTab: View {
|
|||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private func chatRowItem(for chat: PrivateChatListItem) -> some View {
|
private func chatRowItem(for chat: PrivateChatListItem) -> some View {
|
||||||
Button {
|
Button {
|
||||||
selectedChatId = chat.chatId
|
openChat(chat)
|
||||||
} label: {
|
} label: {
|
||||||
ChatRowView(
|
ChatRowView(
|
||||||
chat: chat,
|
chat: chat,
|
||||||
@ -470,16 +469,6 @@ struct ChatsTab: View {
|
|||||||
Label(NSLocalizedString("Удалить чат (скоро)", comment: ""), systemImage: "trash")
|
Label(NSLocalizedString("Удалить чат (скоро)", comment: ""), systemImage: "trash")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.background(
|
|
||||||
NavigationLink(
|
|
||||||
destination: PrivateChatView(chat: chat, currentUserId: currentUserId),
|
|
||||||
tag: chat.chatId,
|
|
||||||
selection: $selectedChatId
|
|
||||||
) {
|
|
||||||
EmptyView()
|
|
||||||
}
|
|
||||||
.hidden()
|
|
||||||
)
|
|
||||||
.listRowInsets(EdgeInsets(top: 4, leading: 16, bottom: 4, trailing: 16))
|
.listRowInsets(EdgeInsets(top: 4, leading: 16, bottom: 4, trailing: 16))
|
||||||
// .listRowSeparator(.hidden)
|
// .listRowSeparator(.hidden)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
@ -488,6 +477,12 @@ struct ChatsTab: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private func openChat(_ chat: PrivateChatListItem) {
|
||||||
|
pendingChatItem = chat
|
||||||
|
isPendingChatActive = true
|
||||||
|
}
|
||||||
|
|
||||||
private var globalSearchLoadingRow: some View {
|
private var globalSearchLoadingRow: some View {
|
||||||
HStack {
|
HStack {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user