This commit is contained in:
cheykrym 2025-10-26 02:34:28 +03:00
parent 3e9d6696b0
commit 9f6beecb49
2 changed files with 15 additions and 5 deletions

View File

@ -94,6 +94,9 @@
}, },
"Email не подтверждён. Подтвердите, чтобы активировать дополнительные проверки." : { "Email не подтверждён. Подтвердите, чтобы активировать дополнительные проверки." : {
"comment" : "Описание необходимости подтверждения email" "comment" : "Описание необходимости подтверждения email"
},
"error" : {
}, },
"Fun Fest" : { "Fun Fest" : {
"comment" : "Fun Fest", "comment" : "Fun Fest",

View File

@ -10,6 +10,7 @@ struct BlockedUsersView: View {
@State private var showUnblockConfirmation = false @State private var showUnblockConfirmation = false
@State private var removingUserIds: Set<UUID> = [] @State private var removingUserIds: Set<UUID> = []
@State private var activeAlert: ActiveAlert? @State private var activeAlert: ActiveAlert?
@State private var errorMessageDown: String?
private let blockedUsersService = BlockedUsersService() private let blockedUsersService = BlockedUsersService()
private let limit = 20 private let limit = 20
@ -24,11 +25,13 @@ struct BlockedUsersView: View {
emptyState emptyState
} else { } else {
usersSection usersSection
if isLoading && !blockedUsers.isEmpty { if isLoading {
Section { Section {
ProgressView() ProgressView()
.frame(maxWidth: .infinity, alignment: .center) .frame(maxWidth: .infinity, alignment: .center)
} }
} else if errorMessageDown != nil{
Text("error")
} }
} }
} }
@ -117,9 +120,11 @@ struct BlockedUsersView: View {
} }
.disabled(removingUserIds.contains(user.id)) .disabled(removingUserIds.contains(user.id))
} }
.task { .onAppear {
if user == blockedUsers.last, hasMore, !isLoading { if user.id == blockedUsers.last?.id {
await loadBlockedUsers() Task {
await loadBlockedUsers()
}
} }
} }
} }
@ -158,6 +163,7 @@ struct BlockedUsersView: View {
@MainActor @MainActor
private func loadBlockedUsers() async { private func loadBlockedUsers() async {
errorMessageDown = nil
guard !isLoading, hasMore else { guard !isLoading, hasMore else {
return return
} }
@ -180,6 +186,7 @@ struct BlockedUsersView: View {
loadError = message loadError = message
} }
activeAlert = .error(message: message) activeAlert = .error(message: message)
errorMessageDown = message
if AppConfig.DEBUG { print("[BlockedUsersView] load blocked users failed: \(error)") } if AppConfig.DEBUG { print("[BlockedUsersView] load blocked users failed: \(error)") }
} }
} }