MESSENGER-5556 fix maintenance sync

This commit is contained in:
JanNiklas Grabowski
2024-03-20 14:05:18 +01:00
parent 01e3255631
commit 60ca0cab30
15 changed files with 221 additions and 105 deletions

View File

@@ -130,7 +130,7 @@ final class AuthenticationLoginCoordinator: Coordinator, Presentable {
self.showForgotPasswordScreen()
}
case .login(let username, let password):
if BWIBuildSettings.shared.bwiCheckAppVersion && ValidAppVersionsDefaultService().isCurrentAppVersionDeprecated() {
if BWIBuildSettings.shared.bwiCheckAppVersion && ValidAppVersionsDefaultService.shared.isCurrentAppVersionDeprecated() {
self.authenticationLoginViewModel.displayError(.appVersion)
} else {
self.login(username: username, password: password)

View File

@@ -24,7 +24,6 @@ struct AuthenticationServerSelectionScreen: View {
@Environment(\.theme) private var theme
private let service = ServerDowntimeDefaultService()
@State private var showAlertForMissingCameraAuthorization = false
@State private var showAlertForInvalidServer = false
@@ -98,7 +97,7 @@ struct AuthenticationServerSelectionScreen: View {
if isInvalidServerAlert {
return self.invalidServerAlert()
} else {
return service.alert(alertType: activeAlert) {
return ServerDowntimeDefaultService.shared.alert(alertType: activeAlert) {
self.submit()
}
}
@@ -281,12 +280,12 @@ struct AuthenticationServerSelectionScreen: View {
isFetchingDowntime = true // show progresview
if BWIBuildSettings.shared.useTestDataForDowntime {
service.fetchDowntimes {
ServerDowntimeDefaultService.shared.fetchDowntimes {
self.isFetchingDowntime = false // hide progressview
self.showAlertIfNeeded()
}
} else {
service.fetchDowntimesWithDirectRequest(localUrlString:viewModel.homeserverAddress) { success in
ServerDowntimeDefaultService.shared.fetchDowntimesWithDirectRequest(localUrlString:viewModel.homeserverAddress) { success in
DispatchQueue.main.async {
self.isFetchingDowntime = false // hide progressview
if success {
@@ -304,8 +303,8 @@ struct AuthenticationServerSelectionScreen: View {
}
private func showAlertIfNeeded() {
if service.showAlert() {
activeAlert = service.alertType()
if ServerDowntimeDefaultService.shared.showAlert() {
activeAlert = ServerDowntimeDefaultService.shared.alertType()
showAlert = true
} else {
self.submit()