Skip to content

Commit

Permalink
Fixing double navigation to the same place
Browse files Browse the repository at this point in the history
  • Loading branch information
leandroBorgesFerreira committed Sep 4, 2024
1 parent 627f130 commit ba3436d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ fun NavController.navigateToNewNote() {
}

fun NavController.navigateToNote(id: String, title: String) {
navigate("${Destinations.EDITOR.id}/$id/$title")
val noteId = this.currentBackStackEntry?.arguments?.getString("noteId")

if (noteId != id) {
navigate("${Destinations.EDITOR.id}/$id/$title")
}
}

fun NavController.navigateToAccount() {
Expand Down

0 comments on commit ba3436d

Please sign in to comment.