From 5787811a5b9392f98d94ba6d3a72dba567284bbb Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 19 May 2019 08:37:49 +0200 Subject: [PATCH 1/2] BUG FIXED: Master App was deleting ALL localstorage when logging out including information of others including Canvas APP --- client/src/auth/index.js | 4 +++- client/src/graphql/apollo.js | 4 +++- client/src/views/layout/header/index.js | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/src/auth/index.js b/client/src/auth/index.js index 8ef99e1ff..e616758b2 100644 --- a/client/src/auth/index.js +++ b/client/src/auth/index.js @@ -213,7 +213,9 @@ class Auth { logout () { // Clear access token and ID token from local storage - window.localStorage.clear() + window.localStorage.removeItem('access_token') + window.localStorage.removeItem('user') + window.localStorage.removeItem('name') deleteCookie('ajs_anonymous_id') deleteCookie('ajs_user_id') deleteCookie('current_tenant') diff --git a/client/src/graphql/apollo.js b/client/src/graphql/apollo.js index a07faac41..283cfc868 100644 --- a/client/src/graphql/apollo.js +++ b/client/src/graphql/apollo.js @@ -15,7 +15,9 @@ const authRetryLink = onError( // User access token has expired // console.log('authLink: ', graphQLErrors) // check for error message to intercept and resend with Auth0 access token if (graphQLErrors[0].message === 'Context creation failed: jwt expired') { - window.localStorage.clear() + window.localStorage.removeItem('access_token') + window.localStorage.removeItem('user') + window.localStorage.removeItem('name') location.reload() } else if (graphQLErrors[0].message === 'Not logged in') { // We assume we have auth0 access token needed to run the async request diff --git a/client/src/views/layout/header/index.js b/client/src/views/layout/header/index.js index 793531d83..224129f4a 100644 --- a/client/src/views/layout/header/index.js +++ b/client/src/views/layout/header/index.js @@ -76,7 +76,9 @@ class Header extends Component { let { onTop, mobileOpen, openedMenu } = this.state if (window.localStorage.getItem('access_token')) { if (jwtDecode(window.localStorage.getItem('access_token')).exp < new Date().getTime() / 1000) { - window.localStorage.clear() + window.localStorage.removeItem('access_token') + window.localStorage.removeItem('user') + window.localStorage.removeItem('name') window.location.reload() } } @@ -86,7 +88,7 @@ class Header extends Component { if (authenticated && !(this.state.user !== undefined && this.state.user !== null)) { return } - let cssChildren = submenus.length === 0 ? null : 'hasChildren'; + let cssChildren = submenus.length === 0 ? null : 'hasChildren' return (
  • this.toggleMenuOpen(index, bigScreen)} From 9884f24c06cbb479f55b5c56e09f96ab48f2a858 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 24 May 2019 15:12:47 +0200 Subject: [PATCH 2/2] Instructions Removed --- client/src/views/home/index.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/client/src/views/home/index.js b/client/src/views/home/index.js index ee2f78691..9ecfbfa53 100644 --- a/client/src/views/home/index.js +++ b/client/src/views/home/index.js @@ -17,31 +17,31 @@ class Home extends Component { } render () { let user = JSON.parse(this.state.user) - if(this.state.user !== undefined && this.state.user !== null){} + if (this.state.user !== undefined && this.state.user !== null) {} return ( {this.state.user !== undefined && this.state.user !== null && (
    - DEMO OVERVIEW - 1. Create a Team and Fork the Template Bots → - 2. Visit the Strategizer and learn how to build a strategy → - 3. Run a clone instance of your Simulator bot to test the strategy → - 4. View the results of your strategy in the charts → - 5. Now use your strategy with your trading bot by running a backtest clone instance → - 5. (Optional) Add an exchange API key to run your trading bot live → + + + + + + +
    )} {(this.state.user === undefined || this.state.user === null) && ( @@ -56,7 +56,7 @@ class Home extends Component { However, you may encounter occasional instability and errors. - At this early stage, the focus of the Superalgos Platform is the Strategizer, a tool directed mostly at traders. + At this early stage, the focus of the Superalgos Platform is the Strategizer, a tool directed mostly at traders. To try out the Demo version hosted here you will need to Sign Up / Login. Once you are logged in, you will find basic instructions on how to proceed, at this home page (click the Superalgos logo to return to this home page). @@ -64,7 +64,7 @@ class Home extends Component {
    - If you are a developer, trying out the Strategizer may open your eyes as of what may be achieved with the + If you are a developer, trying out the Strategizer may open your eyes as of what may be achieved with the Strategizer and the Superalgos Platform in general.