mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
@@ -53,7 +53,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
roomSummaryProvider = userSession.clientProxy.roomSummaryProvider
|
||||
inviteSummaryProvider = userSession.clientProxy.inviteSummaryProvider
|
||||
|
||||
super.init(initialViewState: HomeScreenViewState(userID: userSession.userID),
|
||||
super.init(initialViewState: .init(userID: userSession.userID),
|
||||
imageProvider: userSession.mediaProvider)
|
||||
|
||||
userSession.callbacks
|
||||
@@ -80,6 +80,19 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
.weakAssign(to: \.state.userDisplayName, on: self)
|
||||
.store(in: &cancellables)
|
||||
|
||||
userSession.clientProxy.secureBackupController.recoveryKeyState
|
||||
.receive(on: DispatchQueue.main)
|
||||
.map { state in
|
||||
state == .unknown || state == .disabled
|
||||
}
|
||||
.sink { [weak self] requiresSecureBackupSetup in
|
||||
guard let self else { return }
|
||||
|
||||
state.showUserMenuBadge = requiresSecureBackupSetup && appSettings.chatBackupEnabled
|
||||
state.showSettingsMenuOptionBadge = requiresSecureBackupSetup && appSettings.chatBackupEnabled
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
selectedRoomPublisher
|
||||
.weakAssign(to: \.state.selectedRoomID, on: self)
|
||||
.store(in: &cancellables)
|
||||
|
||||
Reference in New Issue
Block a user