From da5e531812629d2c4dbe29e32922df1dae439b8e Mon Sep 17 00:00:00 2001 From: rahuldsce Date: Sat, 28 Mar 2020 18:44:18 +0530 Subject: [PATCH] Edgecloud 2223 (#201) * Reset map on region change --- src/container/MexListView.js | 2 -- src/utils/JsonUtil.js | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/container/MexListView.js b/src/container/MexListView.js index d29000b72e..8c96d597f2 100644 --- a/src/container/MexListView.js +++ b/src/container/MexListView.js @@ -478,8 +478,6 @@ class MexListView extends React.Component { if (this.requestCount === 0 && dataList.length === 0) { this.props.handleAlertInfo('error', 'Requested data is empty') } - - this.setState({ dataList: dataList }) diff --git a/src/utils/JsonUtil.js b/src/utils/JsonUtil.js index 1d7a713860..9dfa89da94 100644 --- a/src/utils/JsonUtil.js +++ b/src/utils/JsonUtil.js @@ -2,7 +2,10 @@ export const toJson = (data) => { let toJson = [] if (data) { if (typeof data === 'object') { - toJson = data.length>0 ? data : [data] + if(data) + { + toJson = Array.isArray(data) ? data : [data] + } } else { let toArray = data.split('\n') toArray.pop();