File tree Expand file tree Collapse file tree 1 file changed +0
-12
lines changed
WooCommerce/Classes/POS/Presentation/Reusable Views Expand file tree Collapse file tree 1 file changed +0
-12
lines changed Original file line number Diff line number Diff line change 11import SwiftUI
2- import Combine
32
43class POSModalManager : ObservableObject {
54 @Published private( set) var isPresented : Bool = false
65 @Published private( set) var allowsInteractiveDismissal : Bool = true
76 private var contentBuilder : ( ( ) -> AnyView ) ?
87 private var onDismiss : ( ( ) -> Void ) ?
9- private var subscriptions = Set < AnyCancellable > ( )
108
119 func present< Content: View > ( onDismiss: @escaping ( ) -> Void , content: @escaping ( ) -> Content ) {
1210 contentBuilder = { AnyView ( content ( ) ) }
1311 self . onDismiss = onDismiss
1412 isPresented = true
15-
16- $isPresented
17- . sink { [ weak self] _ in
18- guard let self else { return }
19- if !isPresented {
20- reset ( )
21- }
22- }
23- . store ( in: & subscriptions)
2413 }
2514
2615 func dismiss( ) {
@@ -45,6 +34,5 @@ class POSModalManager: ObservableObject {
4534 onDismiss = nil
4635 allowsInteractiveDismissal = true
4736 contentBuilder = nil
48- subscriptions = Set ( )
4937 }
5038}
You can’t perform that action at this time.
0 commit comments