From c3d181369511e2e0710906d8911a4d9a1ca1a1ba Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Tue, 6 Nov 2018 09:01:24 +0530 Subject: [PATCH] Add an error page for app config (window.CONFIG) not being loaded --- frontend/my/src/App.js | 12 +++++++++++- frontend/my/src/index.css | 8 ++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/frontend/my/src/App.js b/frontend/my/src/App.js index 7210f2c..73a5d08 100644 --- a/frontend/my/src/App.js +++ b/frontend/my/src/App.js @@ -1,7 +1,7 @@ import React from 'react' import Utils from './utils' import { BrowserRouter } from 'react-router-dom' -import { notification } from "antd" +import { Icon, notification } from "antd" import axios from 'axios' import qs from 'qs' @@ -121,6 +121,16 @@ class App extends React.PureComponent { } render() { + if(!window.CONFIG) { + return( +
+

Something's not right

+

The app configuration could not be loaded. + Please ensure that the app is running and then refresh this page.

+
+ ) + } + return (