From dda1f8454a303d93611854b5c7bd88e73b84a7a1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 23 Apr 2020 15:50:06 +0100 Subject: [PATCH] fix supported browser logic Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vector/index.ts b/src/vector/index.ts index a8f1538f..52fd2b6a 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -78,10 +78,7 @@ function checkBrowserFeatures() { return featureComplete; } -let acceptBrowser = checkBrowserFeatures(); -if (!acceptBrowser && window.localStorage) { - acceptBrowser = Boolean(window.localStorage.getItem("mx_accepts_unsupported_browser")); -} +const supportedBrowser = checkBrowserFeatures(); // React depends on Map & Set which we check for using modernizr's es6collections // if modernizr fails we may not have a functional react to show the error message. @@ -148,6 +145,11 @@ async function start() { // await things settling so that any errors we have to render have features like i18n running await settled(loadSkinPromise, loadThemePromise, loadLanguagePromise); + let acceptBrowser = supportedBrowser; + if (!acceptBrowser && window.localStorage) { + acceptBrowser = Boolean(window.localStorage.getItem("mx_accepts_unsupported_browser")); + } + // ########################## // error handling begins here // ##########################