diff --git a/yobble/Resources/Localizable.xcstrings b/yobble/Resources/Localizable.xcstrings index c81d6e6..f22bdb8 100644 --- a/yobble/Resources/Localizable.xcstrings +++ b/yobble/Resources/Localizable.xcstrings @@ -2287,4 +2287,4 @@ } }, "version" : "1.0" -} +} \ No newline at end of file diff --git a/yobble/Views/Tab/ChatsTab.swift b/yobble/Views/Tab/ChatsTab.swift index f212733..677737f 100644 --- a/yobble/Views/Tab/ChatsTab.swift +++ b/yobble/Views/Tab/ChatsTab.swift @@ -108,14 +108,16 @@ struct ChatsTab: View { HStack(alignment: .top, spacing: 8) { Image(systemName: "exclamationmark.triangle.fill") .foregroundColor(.orange) + Text(message) .font(.subheadline) .foregroundColor(.orange) Spacer(minLength: 0) - Button(action: { viewModel.refresh() }) { - Text(NSLocalizedString("Обновить", comment: "")) - .font(.subheadline) - } + +// Button(action: triggerChatsReload) { +// Text(NSLocalizedString("Обновить", comment: "")) +// .font(.subheadline) +// } } .padding(.vertical, 4) } @@ -139,9 +141,10 @@ struct ChatsTab: View { globalSearchContent } } else { - if let message = viewModel.errorMessage, viewModel.chats.isEmpty { - errorState(message: message) - } else if viewModel.chats.isEmpty { +// if let message = viewModel.errorMessage, viewModel.chats.isEmpty { +// errorState(message: message) +// } else + if viewModel.chats.isEmpty { emptyState } else { @@ -296,9 +299,11 @@ struct ChatsTab: View { private var globalSearchContent: some View { if isGlobalSearchLoading { globalSearchLoadingRow - } else if let error = globalSearchError { - globalSearchErrorRow(message: error) - } else if globalSearchResults.isEmpty { + } else +// if let error = globalSearchError { +// globalSearchErrorRow(message: error) +// } else + if globalSearchResults.isEmpty { globalSearchEmptyRow } else { ForEach(globalSearchResults) { user in @@ -341,7 +346,7 @@ struct ChatsTab: View { .font(.body) .multilineTextAlignment(.center) .foregroundColor(.primary) - Button(action: { viewModel.loadInitialChats(force: true) }) { + Button(action: triggerChatsReload) { Text(NSLocalizedString("Повторить", comment: "")) .font(.headline) } @@ -359,7 +364,7 @@ struct ChatsTab: View { Text(NSLocalizedString("Пока что у вас нет чатов", comment: "")) .font(.body) .foregroundColor(.secondary) - Button(action: { viewModel.refresh() }) { + Button(action: triggerChatsReload) { Text(NSLocalizedString("Обновить", comment: "")) } .buttonStyle(.bordered) @@ -381,6 +386,10 @@ struct ChatsTab: View { .listRowSeparator(.hidden) } + private func triggerChatsReload() { + viewModel.loadInitialChats(force: true) + } + @ViewBuilder private func chatRowItem(for chat: PrivateChatListItem) -> some View { Button {