Add sunset banners guiding users to install Element X when registering against a server with MAS. (#7890)

This commit is contained in:
Doug
2025-01-10 13:22:03 +00:00
committed by GitHub
parent 7da4b1c139
commit ee2073a8e3
33 changed files with 498 additions and 60 deletions
@@ -37,6 +37,8 @@ class AuthenticationServerSelectionViewModel: AuthenticationServerSelectionViewM
Task { await callback?(.dismiss) }
case .clearFooterError:
Task { await clearFooterError() }
case .downloadReplacementApp(let replacementApp):
Task { await callback?(.downloadReplacementApp(replacementApp)) }
}
}
@@ -44,10 +46,14 @@ class AuthenticationServerSelectionViewModel: AuthenticationServerSelectionViewM
switch type {
case .footerMessage(let message):
withAnimation {
state.footerErrorMessage = message
state.footerError = .message(message)
}
case .openURLAlert:
state.bindings.alertInfo = AlertInfo(id: .openURLAlert, title: VectorL10n.roomMessageUnableOpenLinkErrorMessage)
case .requiresReplacementApp:
withAnimation {
state.footerError = .sunsetBanner
}
}
}
@@ -55,7 +61,7 @@ class AuthenticationServerSelectionViewModel: AuthenticationServerSelectionViewM
/// Clear any errors shown in the text field footer.
@MainActor private func clearFooterError() {
guard state.footerErrorMessage != nil else { return }
withAnimation { state.footerErrorMessage = nil }
guard state.footerError != nil else { return }
withAnimation { state.footerError = nil }
}
}