Prevent the dismissal callback from being called multiple times if changes happen on the navigation coordinators directly from it

This commit is contained in:
Stefan Ceriu
2023-03-01 09:03:17 +02:00
committed by Stefan Ceriu
parent cadae2170b
commit 73dcfe2f27

View File

@@ -36,9 +36,11 @@ class NavigationModule: Identifiable, Hashable {
func tearDown() {
coordinator?.stop()
dismissalCallback?()
coordinator = nil
let callback = dismissalCallback
dismissalCallback = nil
callback?()
}
nonisolated static func == (lhs: NavigationModule, rhs: NavigationModule) -> Bool {