mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Add UserIndicator.disableInteractiveDismiss (#993)
This commit is contained in:
parent
30c39130fc
commit
87075eecfd
@ -17,9 +17,13 @@
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
enum UserIndicatorType {
|
||||
enum UserIndicatorType: Equatable {
|
||||
case toast
|
||||
case modal
|
||||
case modal(interactiveDismissDisabled: Bool)
|
||||
|
||||
static var modal: Self {
|
||||
.modal(interactiveDismissDisabled: false)
|
||||
}
|
||||
}
|
||||
|
||||
struct UserIndicator: Equatable, Identifiable {
|
||||
@ -51,4 +55,13 @@ struct UserIndicator: Equatable, Identifiable {
|
||||
return progress.publisher.eraseToAnyPublisher()
|
||||
}
|
||||
}
|
||||
|
||||
var interactiveDismissDisabled: Bool {
|
||||
switch type {
|
||||
case .toast:
|
||||
return false
|
||||
case .modal(let interactiveDismissDisabled):
|
||||
return interactiveDismissDisabled
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ struct UserIndicatorModalView: View {
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(.black.opacity(0.1))
|
||||
.ignoresSafeArea()
|
||||
.interactiveDismissDisabled(indicator.interactiveDismissDisabled)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ class CreateRoomViewModel: CreateRoomViewModelType, CreateRoomViewModelProtocol
|
||||
|
||||
private func showLoadingIndicator() {
|
||||
userIndicatorController?.submitIndicator(UserIndicator(id: Self.loadingIndicatorIdentifier,
|
||||
type: .modal,
|
||||
type: .modal(interactiveDismissDisabled: true),
|
||||
title: L10n.commonLoading,
|
||||
persistent: true))
|
||||
}
|
||||
|
@ -80,7 +80,10 @@ class RoomDetailsEditScreenViewModel: RoomDetailsEditScreenViewModelType, RoomDe
|
||||
defer {
|
||||
userIndicatorController.retractIndicatorWithId(userIndicatorID)
|
||||
}
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: userIndicatorID, type: .modal, title: L10n.commonLoading, persistent: true))
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: userIndicatorID,
|
||||
type: .modal(interactiveDismissDisabled: true),
|
||||
title: L10n.commonLoading,
|
||||
persistent: true))
|
||||
|
||||
let mediaResult = await mediaPreprocessor.processMedia(at: url)
|
||||
|
||||
@ -101,7 +104,10 @@ class RoomDetailsEditScreenViewModel: RoomDetailsEditScreenViewModelType, RoomDe
|
||||
defer {
|
||||
userIndicatorController.retractIndicatorWithId(userIndicatorID)
|
||||
}
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: userIndicatorID, type: .modal, title: L10n.screenRoomDetailsUpdatingRoom, persistent: true))
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: userIndicatorID,
|
||||
type: .modal(interactiveDismissDisabled: true),
|
||||
title: L10n.screenRoomDetailsUpdatingRoom,
|
||||
persistent: true))
|
||||
|
||||
do {
|
||||
try await withThrowingTaskGroup(of: Void.self) { group in
|
||||
|
Loading…
x
Reference in New Issue
Block a user