mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add UserIndicator.disableInteractiveDismiss (#993)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user