fix: only update URL if active list is still same
If you rapidly move from a list view while it was being refreshed then changed URL is applied on a page that MIGHT not be the list/report view. This check ensures that same page is present before updating URL.
This commit is contained in:
parent
261fbfcd11
commit
39c5d0d454
2 changed files with 7 additions and 2 deletions
|
|
@ -1456,7 +1456,10 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
on_update() {}
|
||||
|
||||
update_url_with_filters() {
|
||||
window.history.replaceState(null, null, this.get_url_with_filters());
|
||||
if (frappe.get_route_str() == this.page_name) {
|
||||
// only update URL if the route still matches current page.
|
||||
window.history.replaceState(null, null, this.get_url_with_filters());
|
||||
}
|
||||
}
|
||||
|
||||
get_url_with_filters() {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
|
|||
}
|
||||
|
||||
update_url_with_filters() {
|
||||
window.history.replaceState(null, null, this.get_url_with_filters());
|
||||
if (frappe.get_route_str() == this.page_name) {
|
||||
window.history.replaceState(null, null, this.get_url_with_filters());
|
||||
}
|
||||
}
|
||||
|
||||
get_url_with_filters() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue