Skip to content

Commit

Permalink
Fix IE 11 support (#8990)
Browse files Browse the repository at this point in the history
* Fix IE 11 support

IE 11 doesn't support Array.prototype.find

* Fix linting issues
  • Loading branch information
pakastin authored and mourner committed Nov 19, 2019
1 parent 6b424fe commit aa0f7c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ui/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,14 @@ class Hash {
const hash = window.location.hash.replace('#', '');
if (this._hashName) {
// Split the parameter-styled hash into parts and find the value we need
const keyval = hash.split('&').map(
let keyval;
hash.split('&').map(
part => part.split('=')
).find(part => part[0] === this._hashName);
).forEach(part => {
if (part[0] === this._hashName) {
keyval = part;
}
});
return (keyval ? keyval[1] || '' : '').split('/');
}
return hash.split('/');
Expand Down

0 comments on commit aa0f7c3

Please sign in to comment.