rundfunk47 / stinsen

Coordinators in SwiftUI. Simple, powerful and elegant.
MIT License
907 stars 95 forks source link

Bugfix: Ensure coordinator belongs to current tree at onDisappear #2

Closed veronikaklikarova closed 3 years ago

veronikaklikarova commented 3 years ago

My team at Mirage discovered and fixed an issue, please review and merge!

When a coordinator has two childcoordinators, in the case of a split view in our case, the onDisappear will pick out the wrong appearingMetadata and the wrong coordinator will be picked.

To test: Create a view with two coordinators Push a coordinator Press back to dismiss Push another coordinator

Expected result: Another coordinator should be pushed

Actual result: Nothing is pushed

rundfunk47 commented 3 years ago

I thought about implementing a more "correct" solution here when writing this code, but couldn't come up with a use-case where it would be needed. Didn't think about split views! This solution looks good 👍🏼 Merging!