Automatically sign out when toggling the SSS feature flag. (#3071)

This commit is contained in:
Doug
2024-07-23 11:55:51 +01:00
committed by GitHub
parent 9879552b46
commit bf22250b45
14 changed files with 43 additions and 14 deletions
@@ -31,6 +31,16 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
let state = DeveloperOptionsScreenViewState(elementCallBaseURL: elementCallBaseURL, bindings: bindings)
super.init(initialViewState: state)
context.$viewState
.map(\.bindings.simplifiedSlidingSyncEnabled)
.removeDuplicates()
.dropFirst() // Ignore the initial value received when opening the screen.
.sink { [weak self] isEnabled in
MXLog.error("Toggled simplifiedSlidingSyncEnabled: \(isEnabled). Signing out.")
self?.actionsSubject.send(.forceLogout)
}
.store(in: &cancellables)
}
override func process(viewAction: DeveloperOptionsScreenViewAction) {