mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Remove the global UserIndicatorController.alertInfo, replacing it with local alertInfo usage. (#5087)
This commit is contained in:
@@ -92,6 +92,11 @@ struct RoomScreenViewState: BindableState {
|
||||
struct RoomScreenViewStateBindings {
|
||||
/// The view model used to present a QuickLook media preview.
|
||||
var mediaPreviewViewModel: TimelineMediaPreviewViewModel?
|
||||
var alertInfo: AlertInfo<RoomScreenAlertType>?
|
||||
}
|
||||
|
||||
enum RoomScreenAlertType {
|
||||
case unknown
|
||||
}
|
||||
|
||||
enum RoomScreenFooterViewAction {
|
||||
|
||||
@@ -286,7 +286,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
showLoadingIndicator()
|
||||
|
||||
if case .failure = await clientProxy.pinUserIdentity(userID) {
|
||||
userIndicatorController.alertInfo = .init(id: .init(), title: L10n.commonError)
|
||||
state.bindings.alertInfo = .init(id: .unknown, title: L10n.commonError)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
showLoadingIndicator()
|
||||
|
||||
if case .failure = await clientProxy.withdrawUserIdentityVerification(userID) {
|
||||
userIndicatorController.alertInfo = .init(id: .init(), title: L10n.commonError)
|
||||
state.bindings.alertInfo = .init(id: .unknown, title: L10n.commonError)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ struct RoomScreen: View {
|
||||
.toolbar { toolbar }
|
||||
.toolbarBackground(.visible, for: .navigationBar) // Fix the toolbar's background.
|
||||
.overlay { loadingIndicator }
|
||||
.alert(item: $context.alertInfo)
|
||||
.timelineMediaPreview(viewModel: $context.mediaPreviewViewModel)
|
||||
.track(screen: .Room)
|
||||
.sentryTrace("\(Self.self)")
|
||||
|
||||
Reference in New Issue
Block a user