mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Fix bug accepting identity server terms from the Setting Discovery section.
This commit is contained in:
@@ -54,11 +54,11 @@ import Foundation
|
||||
func process(viewAction: SettingsDiscoveryViewAction) {
|
||||
switch viewAction {
|
||||
case .load:
|
||||
self.checkTerms()
|
||||
checkTerms()
|
||||
case .acceptTerms:
|
||||
self.acceptTerms()
|
||||
coordinatorDelegate?.settingsDiscoveryViewModelDidTapAcceptIdentityServerTerms(self)
|
||||
case .select(threePid: let threePid):
|
||||
self.coordinatorDelegate?.settingsDiscoveryViewModel(self, didSelectThreePidWith: threePid.medium.identifier, and: threePid.address)
|
||||
coordinatorDelegate?.settingsDiscoveryViewModel(self, didSelectThreePidWith: threePid.medium.identifier, and: threePid.address)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,28 +114,6 @@ import Foundation
|
||||
})
|
||||
}
|
||||
|
||||
private func acceptTerms() {
|
||||
guard let identityService = self.identityService else {
|
||||
self.update(viewState: .loaded(displayMode: .noIdentityServer))
|
||||
return
|
||||
}
|
||||
|
||||
// Launch an identity server request to trigger terms modal apparition
|
||||
identityService.account { (response) in
|
||||
switch response {
|
||||
case .success:
|
||||
// Display three pids if presents
|
||||
self.updateViewStateFromCurrentThreePids()
|
||||
case .failure(let error):
|
||||
if MXError(nsError: error)?.errcode == kMXErrCodeStringTermsNotSigned {
|
||||
// Identity terms modal should appear
|
||||
} else {
|
||||
self.update(viewState: .error(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func canCheckTerms() -> Bool {
|
||||
guard let viewState = self.viewState else {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user