diff --git a/yobble/Views/Tab/Settings/BlockedUsersView.swift b/yobble/Views/Tab/Settings/BlockedUsersView.swift index fd5d301..60bfc17 100644 --- a/yobble/Views/Tab/Settings/BlockedUsersView.swift +++ b/yobble/Views/Tab/Settings/BlockedUsersView.swift @@ -80,10 +80,10 @@ struct BlockedUsersView: View { private var usersSection: some View { Section(header: Text(NSLocalizedString("Заблокированные", comment: ""))) { - ForEach(blockedUsers) { user in - userRow(user) + ForEach(Array(blockedUsers.enumerated()), id: \.element.id) { index, user in + userRow(user, index: index) } - if isLoading { + if isLoading && !blockedUsers.isEmpty { Text("Идет загрузка...") .foregroundColor(.gray) .frame(maxWidth: .infinity, alignment: .center) @@ -99,7 +99,7 @@ struct BlockedUsersView: View { } } - private func userRow(_ user: BlockedUser) -> some View { + private func userRow(_ user: BlockedUser, index: Int) -> some View { HStack(spacing: 12) { Circle() .fill(Color.accentColor.opacity(0.15)) @@ -131,7 +131,7 @@ struct BlockedUsersView: View { .disabled(removingUserIds.contains(user.id)) } .onAppear { - if user.id == blockedUsers.last?.id { + if index >= blockedUsers.count - 5 { Task { await loadBlockedUsers() }