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 не подтверждён. Подтвердите, чтобы активировать дополнительные проверки." : {
"comment" : "Описание необходимости подтверждения email"
},
"error" : {
},
"Fun Fest" : {
"comment" : "Fun Fest",

View File

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