mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Automatic discovery of the sliding sync proxy. (#535)
* Automatic discovery of the sliding sync proxy. * Handle homeserver detection from a MXID. * Update sliding sync info link, SDK and bump patch. Add a migration on the new version. The change in restoration token format requires the user to sign in again, but this will fail with the existing device ID.
This commit is contained in:
@@ -38,7 +38,12 @@ struct AlertInfo<T: Hashable>: Identifiable {
|
||||
|
||||
struct AlertButton {
|
||||
let title: String
|
||||
var role: Role = .default
|
||||
let action: (() -> Void)?
|
||||
|
||||
enum Role {
|
||||
case `default`, cancel, destructive
|
||||
}
|
||||
}
|
||||
|
||||
extension AlertInfo {
|
||||
@@ -85,10 +90,19 @@ extension AlertInfo {
|
||||
}
|
||||
|
||||
private func alertButton(for buttonParameters: AlertButton) -> Alert.Button {
|
||||
guard let action = buttonParameters.action else {
|
||||
switch (buttonParameters.role, buttonParameters.action) {
|
||||
case (.default, nil):
|
||||
return .default(Text(buttonParameters.title))
|
||||
case (.default, let action):
|
||||
return .default(Text(buttonParameters.title), action: action)
|
||||
case (.cancel, nil):
|
||||
return .cancel(Text(buttonParameters.title))
|
||||
case (.cancel, let action):
|
||||
return .cancel(Text(buttonParameters.title), action: action)
|
||||
case (.destructive, nil):
|
||||
return .destructive(Text(buttonParameters.title))
|
||||
case (.destructive, let action):
|
||||
return .destructive(Text(buttonParameters.title), action: action)
|
||||
}
|
||||
|
||||
return .default(Text(buttonParameters.title), action: action)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user