mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-08 00:47:41 +02:00
Merge pull request #7562 from vector-im/alfogrillo/dm_no_internet_status
Fix offline state issue in user sessions overview
This commit is contained in:
+11
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ class UserSessionsOverviewService: UserSessionsOverviewServiceProtocol {
|
||||
}
|
||||
|
||||
overviewDataPublisher = .init(UserSessionsOverviewData(currentSession: currentSessionInfo,
|
||||
unverifiedSessions: currentSessionInfo.verificationState == .verified ? [] : [currentSessionInfo],
|
||||
unverifiedSessions: currentSessionInfo.verificationState.isUnverified ? [currentSessionInfo] : [],
|
||||
inactiveSessions: currentSessionInfo.isActive ? [] : [currentSessionInfo],
|
||||
otherSessions: [],
|
||||
linkDeviceEnabled: false))
|
||||
|
||||
@@ -209,6 +209,9 @@ private class MockCrossSigning: MXLegacyCrossSigning {
|
||||
super.init()
|
||||
}
|
||||
|
||||
override var state: MXCrossSigningState {
|
||||
.crossSigningExists
|
||||
}
|
||||
}
|
||||
|
||||
/// A mock `MXDeviceInfo` that can override the `isVerified` state.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Device manager: fix offline state for user's sessions overview.
|
||||
Reference in New Issue
Block a user