Commit d94eedcd authored by Clément's avatar Clément

Merge branch 'bugfix/history-push-state-iframe' into 'master'

bugfix: catch history pushState errors

Closes startinblox/components/sib-editor#4

See merge request !29
parents 5ed7c8f2 ae7e6954
Pipeline #6816 passed with stage
in 27 seconds
......@@ -88,7 +88,9 @@ export default class SIBRouter extends HTMLElement {
updateURL(route, id) {
const path = route.getPath(this.prefix, route.name, route.hasAttribute('use-id') ? id : '', route.name == this.defaultRoute);
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.') }
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment