deduplicate route history
This commit is contained in:
1 parent
39e89c1fac
commit
98de423d99
2 files changed
+14
No files matched your search
@@ -88,6 +88,10 @@ impl<R: Routable> HistoryProvider<R> for MemoryHistory<R> {
|
||||
}
|
||||
|
||||
fn push(&mut self, new: R) {
|
||||
// don't push the same route twice
|
||||
if self.current.to_string() == new.to_string() {
|
||||
return;
|
||||
}
|
||||
let old = std::mem::replace(&mut self.current, new);
|
||||
self.history.push(old);
|
||||
self.future.clear();
|
||||
|
||||
Reference in new issue
Block a user