diff --git a/src/bootstrap/App.js b/src/bootstrap/App.js index 0f6492bf..137fca97 100755 --- a/src/bootstrap/App.js +++ b/src/bootstrap/App.js @@ -1,8 +1,8 @@ import React, { Component } from "react"; -import Init from './Init' +import Init from "./Init"; -import { Provider } from 'react-redux' +import { Provider } from "react-redux"; import AppProvider from "./AppProvider"; // App Context import ErrorBoundary from "./ErrorBoundary"; // Errors @@ -17,33 +17,31 @@ import Spinner from "../components/common/Spinner"; import UnderAuth from "./UnderAuth"; import Initializer from "./Initializer"; // Initializer import { log, connector, connection } from "../utils/helpers"; +import Disclaimer from "JurCommon/Disclaimer"; -log('App init', process.env); +log("App init", process.env); class App extends Component { constructor(props) { super(props); this.connectorValue = connector(); - } componentDidMount() { - if (this.connectorValue === 'connex') { + if (this.connectorValue === "connex") { const { store } = this.props; - global.store=store; + global.store = store; } } render() { const { store, history, testElement } = this.props; - + // log('connnnnnnnnnection---g---', typeof connection) - - - log('App - connector',this.connectorValue) + log("App - connector", this.connectorValue); - if (this.connectorValue === 'web3') { + if (this.connectorValue === "web3") { return ( @@ -58,7 +56,7 @@ class App extends Component { ); - } else if (this.connectorValue === 'connex') { + } else if (this.connectorValue === "connex") { return ( @@ -67,8 +65,9 @@ class App extends Component { + - + diff --git a/src/bootstrap/Initializer.js b/src/bootstrap/Initializer.js index 25414921..31a10b1e 100644 --- a/src/bootstrap/Initializer.js +++ b/src/bootstrap/Initializer.js @@ -1,7 +1,7 @@ /* eslint-disable no-unused-vars */ import React, { PureComponent } from "react"; import { Route, Switch, Router } from "react-router"; // react-router v4 - +import { ConnectedRouter } from "connected-react-router"; import PropTypes from "prop-types"; // Routes @@ -29,7 +29,7 @@ class Initializer extends PureComponent { render() { const { history } = this.props; return ( - + <> {Routes.map((params, key) => ( @@ -39,7 +39,7 @@ class Initializer extends PureComponent { {this.renderTestReport()} - + ); } } diff --git a/src/sagas/User.js b/src/sagas/User.js index ac4f8e47..5e546dbc 100644 --- a/src/sagas/User.js +++ b/src/sagas/User.js @@ -1,4 +1,5 @@ import { put, call, select, takeEvery, takeLatest } from "redux-saga/effects"; +import { push } from "connected-react-router"; import { setLoading } from "./App"; import { dateReducer } from "../utils/helpers"; // helpers @@ -79,8 +80,10 @@ export function* checkUserExist(action) { log("checkUserExist - error.response", error.response); if (error.response.status === 404) { log("checkUserExist - error.response.status", error.response.status); + put(push("/")); // create a new user if missing if (action.type === FETCH_USER) { + log("This is fetch_user action type"); yield put({ type: SET_LOADING, payload: false }); // only dismiss loading } else { yield put({ type: NEW_USER }); // create a new user