MESSENGER-5271 crosssigning - add alert and better strings, only show button when usable

This commit is contained in:
Frank Rotermund
2023-12-05 12:46:26 +01:00
parent 9a997510c5
commit c8a32e3431
8 changed files with 78 additions and 3 deletions
@@ -83,6 +83,18 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai
}
}
// bwi: only show corsssigning button when there is more than one device in your account
func checkCrosssigningDevices() {
self.session.matrixRestClient.devices { [weak self] response in
switch response {
case .success(let devices):
self?.update(viewState: .crosssigningPossible(devices.count > 1))
case .failure:
break
}
}
}
// MARK: - Private
private func loadData() {
@@ -258,6 +270,8 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai
}
if keyVerificationRequest.state == MXKeyVerificationRequestStateReady {
self.update(viewState: .verificationAccepted)
self.unregisterKeyVerificationRequestChangeNotification()
self.coordinatorDelegate?.keyVerificationSelfVerifyWaitViewModel(self,
didAcceptKeyVerificationRequest: keyVerificationRequest)