patch
This commit is contained in:
parent
3e9d6696b0
commit
9f6beecb49
@ -94,6 +94,9 @@
|
|||||||
},
|
},
|
||||||
"Email не подтверждён. Подтвердите, чтобы активировать дополнительные проверки." : {
|
"Email не подтверждён. Подтвердите, чтобы активировать дополнительные проверки." : {
|
||||||
"comment" : "Описание необходимости подтверждения email"
|
"comment" : "Описание необходимости подтверждения email"
|
||||||
|
},
|
||||||
|
"error" : {
|
||||||
|
|
||||||
},
|
},
|
||||||
"Fun Fest" : {
|
"Fun Fest" : {
|
||||||
"comment" : "Fun Fest",
|
"comment" : "Fun Fest",
|
||||||
|
|||||||
@ -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,14 +120,16 @@ 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 {
|
||||||
|
Task {
|
||||||
await loadBlockedUsers()
|
await loadBlockedUsers()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private var emptyState: some View {
|
private var emptyState: some View {
|
||||||
VStack(spacing: 12) {
|
VStack(spacing: 12) {
|
||||||
@ -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)") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user