Merge pull request #17414 from ankush/url_enhancements

fix: misc url/routing fixes
This commit is contained in:
Ankush Menat 2022-07-05 17:07:07 +05:30 committed by GitHub
commit 93c2cb757f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -1456,7 +1456,11 @@ 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 && !this.report_name) {
// only update URL if the route still matches current page.
// do not update if current list is a "saved report".
window.history.replaceState(null, null, this.get_url_with_filters());
}
}
get_url_with_filters() {

View file

@ -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() {