mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Update the SDK.
Handles changes that removed support for the sliding sync proxy.
This commit is contained in:
@@ -145,11 +145,6 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
actionsSubject.send(.presentEncryptionResetScreen)
|
||||
case .skipRecoveryKeyConfirmation:
|
||||
state.securityBannerMode = .dismissed
|
||||
case .confirmSlidingSyncUpgrade:
|
||||
appSettings.slidingSyncDiscovery = .native
|
||||
actionsSubject.send(.logout)
|
||||
case .skipSlidingSyncUpgrade:
|
||||
state.slidingSyncMigrationBannerMode = .dismissed
|
||||
case .updateVisibleItemRange(let range):
|
||||
roomSummaryProvider?.updateVisibleRange(range)
|
||||
case .startChat:
|
||||
@@ -307,30 +302,18 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
/// Check whether we can inform the user about potential migrations
|
||||
/// or have him logout as his proxy is no longer available
|
||||
private func checkSlidingSyncMigration() async {
|
||||
// Not logged in with a proxy, don't need to do anything
|
||||
guard userSession.clientProxy.slidingSyncVersion.isProxy else {
|
||||
guard userSession.clientProxy.needsSlidingSyncMigration else {
|
||||
return
|
||||
}
|
||||
|
||||
let versions = await userSession.clientProxy.availableSlidingSyncVersions
|
||||
|
||||
// Native not available, nothing we can do
|
||||
guard versions.contains(.native) else {
|
||||
return
|
||||
}
|
||||
|
||||
if versions.contains(where: \.isProxy) { // Both available, prompt for migration
|
||||
state.slidingSyncMigrationBannerMode = .show
|
||||
} else { // The proxy has been removed and logout is needed
|
||||
// Delay setting the alert otherwise it automatically gets dismissed. Same as the crashed last run one
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
self.state.bindings.alertInfo = AlertInfo(id: UUID(),
|
||||
title: L10n.bannerMigrateToNativeSlidingSyncForceLogoutTitle,
|
||||
primaryButton: .init(title: L10n.bannerMigrateToNativeSlidingSyncAction) { [weak self] in
|
||||
self?.appSettings.slidingSyncDiscovery = .native
|
||||
self?.actionsSubject.send(.logoutWithoutConfirmation)
|
||||
})
|
||||
}
|
||||
// The proxy is no longer supported so a logout is needed.
|
||||
// Delay setting the alert otherwise it automatically gets dismissed. Same as the crashed last run one
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
self.state.bindings.alertInfo = AlertInfo(id: UUID(),
|
||||
title: L10n.bannerMigrateToNativeSlidingSyncAppForceLogoutTitle,
|
||||
primaryButton: .init(title: L10n.bannerMigrateToNativeSlidingSyncAction) { [weak self] in
|
||||
self?.actionsSubject.send(.logoutWithoutConfirmation)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,14 +443,3 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
message: L10n.errorUnknown)
|
||||
}
|
||||
}
|
||||
|
||||
extension SlidingSyncVersion {
|
||||
var isProxy: Bool {
|
||||
switch self {
|
||||
case .proxy:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user