Explorar el Código

fix(router): navigating forward not working for routes in frappe.re_route

version-14
Sagar Vora hace 4 años
padre
commit
9aeb9ac185
Se han modificado 1 ficheros con 5 adiciones y 4 borrados
  1. +5
    -4
      frappe/public/js/frappe/router.js

+ 5
- 4
frappe/public/js/frappe/router.js Ver fichero

@@ -101,6 +101,7 @@ frappe.router = {
let sub_path = this.get_sub_path();
if (this.re_route(sub_path)) return;

this.current_sub_path = sub_path;
this.current_route = this.parse();
this.set_history(sub_path);
this.render();
@@ -223,14 +224,14 @@ frappe.router = {
// it doesn't allow us to go back to the one prior to "new-doctype-1"
// Hence if this check is true, instead of changing location hash,
// we just do a back to go to the doc previous to the "new-doctype-1"
var re_route_val = this.get_sub_path(frappe.re_route[sub_path]);
if (decodeURIComponent(re_route_val) !== decodeURIComponent(sub_path)) {
const re_route_val = this.get_sub_path(frappe.re_route[sub_path]);
if (re_route_val === this.current_sub_path) {
window.history.back();
return true;
} else {
frappe.set_route(re_route_val);
return true;
}

return true;
}
},



Cargando…
Cancelar
Guardar