From aa0f7c33527a6d6630f1618c9075adee0bf7e679 Mon Sep 17 00:00:00 2001 From: Juha Lindstedt Date: Tue, 19 Nov 2019 15:33:33 +0200 Subject: [PATCH] Fix IE 11 support (#8990) * Fix IE 11 support IE 11 doesn't support Array.prototype.find * Fix linting issues --- src/ui/hash.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ui/hash.js b/src/ui/hash.js index b375c6b0226..fccfea62d83 100644 --- a/src/ui/hash.js +++ b/src/ui/hash.js @@ -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('/');