Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear registry when transitioning to non view state #564

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ios/swiftui/Sources/SwiftUIPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ public struct SwiftUIPlayer: View, HeadlessPlayer {
for plugin in allPlugins { plugin.apply(player: player) }
registry.partialMatchRegistry = partialMatchPlugin

hooks.flowController.tap { flowController in
flowController.hooks.flow.tap { flow in
flow.hooks.transition.tap { [weak self] _, newState in
if (newState.value as? NavigationFlowViewState) == nil {
self?.registry.resetView(releasePartialMatch: false)
}
}
}
}

hooks.viewController.tap { [weak self] controller in
guard let self = self, self.player == playerValue else { return }
self.onViewController(controller)
Expand Down