patch
This commit is contained in:
parent
3e9d6696b0
commit
9f6beecb49
@ -94,6 +94,9 @@
|
||||
},
|
||||
"Email не подтверждён. Подтвердите, чтобы активировать дополнительные проверки." : {
|
||||
"comment" : "Описание необходимости подтверждения email"
|
||||
},
|
||||
"error" : {
|
||||
|
||||
},
|
||||
"Fun Fest" : {
|
||||
"comment" : "Fun Fest",
|
||||
|
||||
@ -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,9 +120,11 @@ struct BlockedUsersView: View {
|
||||
}
|
||||
.disabled(removingUserIds.contains(user.id))
|
||||
}
|
||||
.task {
|
||||
if user == blockedUsers.last, hasMore, !isLoading {
|
||||
await loadBlockedUsers()
|
||||
.onAppear {
|
||||
if user.id == blockedUsers.last?.id {
|
||||
Task {
|
||||
await loadBlockedUsers()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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)") }
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user