Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit 8f2ae7e

Browse files
Merge pull request #47 from xcomponent/issue_39
Issue_39: Spy web doesn't work on IE11 and Edge
2 parents ae337d9 + 9259d01 commit 8f2ae7e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/components/XCSpyApp.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { XCSpyState } from "../reducers/spyReducer";
1212
import { Dispatch } from "redux";
1313
import { setCompositionModel, initSession } from "../actions";
1414
import { withRouter, Redirect } from "react-router-dom";
15-
import { } from "types/react-router-dom";
1615
import { routes } from "../utils/routes";
1716

1817
interface XCSpyAppGlobalProps extends XCSpyAppProps, XCSpyAppCallbackProps {
@@ -72,15 +71,16 @@ class XCSpyApp extends React.Component<XCSpyAppGlobalProps, XCSpyState> {
7271
}
7372

7473
const mapStateToProps = (state: XCSpyState, ownProps): XCSpyAppProps => {
75-
const urlSearchParams = new URLSearchParams(ownProps.location.search);
76-
const currentComponent = urlSearchParams.get(routes.params.currentComponent);
77-
const serverUrl = urlSearchParams.get(routes.params.serverUrl);
78-
const api = urlSearchParams.get(routes.params.api);
74+
const values = {};
75+
ownProps.location.search.replace("?", "").split("&").forEach(element => {
76+
const s = element.split("=");
77+
values[s[0]] = s[1];
78+
});
7979
return {
8080
initialized: state.compositionModel.initialized,
81-
api,
82-
serverUrl,
83-
currentComponent
81+
api: values[routes.params.api],
82+
serverUrl: values[routes.params.serverUrl],
83+
currentComponent: values[routes.params.currentComponent]
8484
};
8585
};
8686

0 commit comments

Comments
 (0)