From 721be6c825c2eca863ea18571eb73d0319946813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 4 Oct 2018 22:10:44 +0100 Subject: [PATCH 1/2] fix(ui): polyfill fetch() This allows it to run on all browsers from the browserslist config --- ui/package.json | 3 ++- ui/src/index.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/package.json b/ui/package.json index 0faec928f..6bc2882f7 100644 --- a/ui/package.json +++ b/ui/package.json @@ -43,7 +43,8 @@ "react-resize-detector": "3.1.3", "react-scripts": "2.0.4", "react-select": "2.1.0", - "react-transition-group": "2.5.0" + "react-transition-group": "2.5.0", + "whatwg-fetch": "3.0.0" }, "scripts": { "start": "NODE_ENV=dev REACT_APP_BACKEND_URI=http://localhost:8080 react-scripts start", diff --git a/ui/src/index.js b/ui/src/index.js index 7d5e9a387..c879aebce 100644 --- a/ui/src/index.js +++ b/ui/src/index.js @@ -2,6 +2,9 @@ // https://babeljs.io/docs/en/babel-polyfill#usage-in-node-browserify-webpack import "@babel/polyfill"; +// fetch() polyfill for IE and some mobile browsers +import "whatwg-fetch"; + import React from "react"; import ReactDOM from "react-dom"; From 19642a553f22df5934b75e7a06aafc59d78443ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 4 Oct 2018 22:26:19 +0100 Subject: [PATCH 2/2] fix(ui): use more compatible body style setter This works on Firefox 33, style[] syntax is only supported for FF >=35 --- ui/src/Components/NavBar/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/Components/NavBar/index.js b/ui/src/Components/NavBar/index.js index 3590ad0aa..910dd78e1 100644 --- a/ui/src/Components/NavBar/index.js +++ b/ui/src/Components/NavBar/index.js @@ -71,7 +71,7 @@ const NavBar = observer( const paddingTop = this.activityStatus.idle ? 0 : this.elementSize.height + 4; - document.body.style["padding-top"] = `${paddingTop}px`; + document.body.style.paddingTop = `${paddingTop}px`; }; onHide = () => {