mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Remove the global UserIndicatorController.alertInfo, replacing it with local alertInfo usage. (#5087)
This commit is contained in:
@@ -226,12 +226,12 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
guard let confirmationParameters = url.confirmationParameters else {
|
||||
return false
|
||||
}
|
||||
ServiceLocator.shared.userIndicatorController.alertInfo = .init(id: .init(),
|
||||
title: L10n.dialogConfirmLinkTitle,
|
||||
message: L10n.dialogConfirmLinkMessage(confirmationParameters.displayString,
|
||||
confirmationParameters.internalURL.absoluteString),
|
||||
primaryButton: .init(title: L10n.actionCancel, role: .cancel, action: nil),
|
||||
secondaryButton: .init(title: L10n.actionContinue) { openURLAction(confirmationParameters.internalURL) })
|
||||
navigationRootCoordinator.alertInfo = .init(id: .init(),
|
||||
title: L10n.dialogConfirmLinkTitle,
|
||||
message: L10n.dialogConfirmLinkMessage(confirmationParameters.displayString,
|
||||
confirmationParameters.internalURL.absoluteString),
|
||||
primaryButton: .init(title: L10n.actionCancel, role: .cancel, action: nil),
|
||||
secondaryButton: .init(title: L10n.actionContinue) { openURLAction(confirmationParameters.internalURL) })
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,9 @@ import SwiftUI
|
||||
overlayModule?.coordinator
|
||||
}
|
||||
|
||||
/// The lowest-level `AlertInfo`, directly available to the root of the app.
|
||||
var alertInfo: AlertInfo<UUID>?
|
||||
|
||||
/// Sets or replaces the presented coordinator
|
||||
/// - Parameter coordinator: the coordinator to display
|
||||
func setRootCoordinator(_ coordinator: (any CoordinatorProtocol)?, animated: Bool = true, dismissalCallback: (() -> Void)? = nil) {
|
||||
@@ -159,6 +162,7 @@ private struct NavigationRootCoordinatorView: View {
|
||||
ZStack {
|
||||
rootCoordinator.rootModule?.coordinator?.toPresentable()
|
||||
}
|
||||
.alert(item: $rootCoordinator.alertInfo)
|
||||
.animation(.elementDefault, value: rootCoordinator.rootModule)
|
||||
.sheet(item: $rootCoordinator.sheetModule) { module in
|
||||
module.coordinator?.toPresentable()
|
||||
|
||||
Reference in New Issue
Block a user