Fixes #2516 - Hide the blocked users section in settings if there aren't any.

This commit is contained in:
Stefan Ceriu
2024-03-01 12:52:49 +02:00
committed by Stefan Ceriu
parent b3e6fdc503
commit d304d98c85
4 changed files with 24 additions and 8 deletions
@@ -72,6 +72,18 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
}
.store(in: &cancellables)
userSession.clientProxy.ignoredUsersPublisher
.receive(on: DispatchQueue.main)
.map {
guard let blockedUsers = $0 else {
return false
}
return !blockedUsers.isEmpty
}
.weakAssign(to: \.state.showBlockedUsers, on: self)
.store(in: &cancellables)
Task {
await userSession.clientProxy.loadUserAvatarURL()
await userSession.clientProxy.loadUserDisplayName()