...
 
Commits (2)
...@@ -88,7 +88,9 @@ export default class SIBRouter extends HTMLElement { ...@@ -88,7 +88,9 @@ export default class SIBRouter extends HTMLElement {
updateURL(route, id) { updateURL(route, id) {
const path = route.getPath(this.prefix, route.name, route.hasAttribute('use-id') ? id : '', route.name == this.defaultRoute); const path = route.getPath(this.prefix, route.name, route.hasAttribute('use-id') ? id : '', route.name == this.defaultRoute);
const prefix = this.useHash ? '#' : '/'; const prefix = this.useHash ? '#' : '/';
history.pushState({}, route.name, prefix + path); // update current URL try {
history.pushState({}, route.name, prefix + path); // update current URL
} catch (e) { console.warn('"history.pushState" is not useable in this context.') }
} }
} }
......