Rebounce navigation events
This commit is contained in:
@@ -53,12 +53,19 @@ export class FSNavigator {
|
||||
}
|
||||
}
|
||||
|
||||
last_requested_path: string = ""
|
||||
navigate = async (path: string, push_history: boolean) => {
|
||||
if (path === this.last_requested_path) {
|
||||
console.debug("FSNavigator: Requested path is equal to current path. Debouncing")
|
||||
return
|
||||
}
|
||||
this.last_requested_path = path
|
||||
|
||||
if (path[0] !== "/") {
|
||||
path = "/" + path
|
||||
}
|
||||
|
||||
console.debug("Navigating to path", path, push_history)
|
||||
console.debug("FSNavigator: Navigating to path", path, push_history)
|
||||
|
||||
try {
|
||||
loading_start()
|
||||
|
||||
Reference in New Issue
Block a user