mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Gate user status behind server support as well as the feature flag. (#5920)
This commit is contained in:
@@ -36,7 +36,7 @@ enum SettingsScreenSecuritySectionMode {
|
||||
struct SettingsScreenViewState: BindableState {
|
||||
var deviceID: String?
|
||||
var userProfile: UserProfile
|
||||
var showUserStatus: Bool
|
||||
var showUserStatus = false
|
||||
var showLinkNewDeviceButton: Bool
|
||||
var accountProfileURL: URL?
|
||||
var showAccountDeactivation: Bool
|
||||
|
||||
@@ -29,7 +29,6 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
||||
|
||||
super.init(initialViewState: .init(deviceID: userSession.clientProxy.deviceID,
|
||||
userProfile: userSession.clientProxy.userProfilePublisher.value,
|
||||
showUserStatus: appSettings.userStatusEnabled,
|
||||
showLinkNewDeviceButton: appSettings.linkNewDeviceEnabled,
|
||||
showAccountDeactivation: userSession.clientProxy.canDeactivateAccount,
|
||||
showDeveloperOptions: appSettings.developerOptionsEnabled,
|
||||
@@ -86,9 +85,12 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
||||
.store(in: &cancellables)
|
||||
|
||||
Task {
|
||||
if appSettings.userStatusEnabled, case .success(true) = await userSession.clientProxy.isUserStatusSupported() {
|
||||
state.showUserStatus = true
|
||||
}
|
||||
await userSession.clientProxy.loadUserProfileIfNeeded()
|
||||
await state.accountProfileURL = userSession.clientProxy.accountURL(action: .profile)
|
||||
}
|
||||
Task { await state.accountProfileURL = userSession.clientProxy.accountURL(action: .profile) }
|
||||
}
|
||||
|
||||
override func process(viewAction: SettingsScreenViewAction) {
|
||||
|
||||
Reference in New Issue
Block a user