Skip to content

Commit 7220b7b

Browse files
committed
Remove additional isPresented check
1 parent ac276c1 commit 7220b7b

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

WooCommerce/Classes/POS/Presentation/Reusable Views/POSModalManager.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
import SwiftUI
2-
import Combine
32

43
class 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
}

0 commit comments

Comments
 (0)