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:
committed by
William Casarin
parent
06eb9d4a0e
commit
7c98489904
@@ -218,6 +218,9 @@ class NavigationCoordinator: ObservableObject {
|
|||||||
@Published var path = [Route]()
|
@Published var path = [Route]()
|
||||||
|
|
||||||
func push(route: Route) {
|
func push(route: Route) {
|
||||||
|
guard route != path.last else {
|
||||||
|
return
|
||||||
|
}
|
||||||
path.append(route)
|
path.append(route)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user