mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Handle offline issue in UserSessionsDataProvider
This commit is contained in:
parent
94d19d49fd
commit
605a4172f1
1 changed files with 11 additions and 2 deletions
|
@ -57,8 +57,17 @@ class UserSessionsDataProvider: UserSessionsDataProviderProtocol {
|
|||
guard let deviceInfo = deviceInfo else {
|
||||
return .permanentlyUnverified
|
||||
}
|
||||
|
||||
guard session.crypto?.crossSigning.canCrossSign == true else {
|
||||
|
||||
// When the app is launched offline the cross signing state is "notBootstrapped"
|
||||
// In this edge case the verification state returned is `.unknown` since we cannot say more even for the current session.
|
||||
guard
|
||||
let crossSigning = session.crypto?.crossSigning,
|
||||
crossSigning.state.rawValue > MXCrossSigningState.notBootstrapped.rawValue
|
||||
else {
|
||||
return .unknown
|
||||
}
|
||||
|
||||
guard crossSigning.canCrossSign else {
|
||||
return deviceInfo.deviceId == session.myDeviceId ? .unverified : .unknown
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue