This commit is contained in:
cheykrym 2025-12-13 00:18:16 +03:00
parent ad0577f1fb
commit c22545a3b8

View File

@ -18,7 +18,6 @@ struct ChatsTab: View {
private let chatService = ChatService()
@AppStorage("chatRowMessageLineLimit") private var messageLineLimitSetting: Int = 2
@StateObject private var viewModel = PrivateChatsViewModel()
@State private var selectedChatId: String?
@State private var searchDragStartProgress: CGFloat = 0
@State private var isSearchGestureActive: Bool = false
@State private var globalSearchResults: [UserSearchResult] = []
@ -447,7 +446,7 @@ struct ChatsTab: View {
@ViewBuilder
private func chatRowItem(for chat: PrivateChatListItem) -> some View {
Button {
selectedChatId = chat.chatId
openChat(chat)
} label: {
ChatRowView(
chat: chat,
@ -470,16 +469,6 @@ struct ChatsTab: View {
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))
// .listRowSeparator(.hidden)
.onAppear {
@ -488,6 +477,12 @@ struct ChatsTab: View {
}
}
private func openChat(_ chat: PrivateChatListItem) {
pendingChatItem = chat
isPendingChatActive = true
}
private var globalSearchLoadingRow: some View {
HStack {
ProgressView()