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

CMP-7240: Update non-android navigateUp to handle single-entry back stack correctly #1736

Merged
merged 1 commit into from
Dec 16, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,13 @@ public actual open class NavController {

@MainThread
public actual open fun navigateUp(): Boolean {
// TODO If there's only one entry, then we may have deep linked into a specific destination
return popBackStack()
if (destinationCountOnBackStack == 1) {
// opposite to the android implementation, we don't start a new window for deep links,
// so we mustn't reopen an initial screen here
return false
} else {
return popBackStack()
}
}

/** Gets the number of non-NavGraph destinations on the back stack */
Expand Down