commit 7c984899047440ff1ef343619d83cdc795f31d89
parent 06eb9d4a0e20132b04eb619db95eb42fe627288c
Author: Davide De Rosa <keeshux@gmail.com>
Date: Thu, 19 Oct 2023 19:04:52 +0200
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>
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/damus/Util/Router.swift b/damus/Util/Router.swift
@@ -218,6 +218,9 @@ class NavigationCoordinator: ObservableObject {
@Published var path = [Route]()
func push(route: Route) {
+ guard route != path.last else {
+ return
+ }
path.append(route)
}