1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00

nav: fix pushing duplicate routes

Skip push if matches top route.

Fixes: https://github.com/damus-io/damus/issues/104
Closes: https://github.com/damus-io/damus/pull/1625
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
Davide De Rosa 2023-10-19 19:04:52 +02:00 committed by William Casarin
parent 06eb9d4a0e
commit 7c98489904

View File

@ -218,6 +218,9 @@ class NavigationCoordinator: ObservableObject {
@Published var path = [Route]()
func push(route: Route) {
guard route != path.last else {
return
}
path.append(route)
}