diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-05-26 02:36:07 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-05-26 03:03:18 +0800 |
commit | e575323c6013b89873b698a7f34da135a4b2c51f (patch) | |
tree | 43ff4bed7fdf007936fc1ba3ee3d113f884dd842 /packages/website/ts/index.tsx | |
parent | 809ac3340cb477d4b46e24d4bad028568beeec06 (diff) | |
download | dexon-sol-tools-e575323c6013b89873b698a7f34da135a4b2c51f.tar dexon-sol-tools-e575323c6013b89873b698a7f34da135a4b2c51f.tar.gz dexon-sol-tools-e575323c6013b89873b698a7f34da135a4b2c51f.tar.bz2 dexon-sol-tools-e575323c6013b89873b698a7f34da135a4b2c51f.tar.lz dexon-sol-tools-e575323c6013b89873b698a7f34da135a4b2c51f.tar.xz dexon-sol-tools-e575323c6013b89873b698a7f34da135a4b2c51f.tar.zst dexon-sol-tools-e575323c6013b89873b698a7f34da135a4b2c51f.zip |
Auto-show onboarding flow on first page view
Diffstat (limited to 'packages/website/ts/index.tsx')
-rw-r--r-- | packages/website/ts/index.tsx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/packages/website/ts/index.tsx b/packages/website/ts/index.tsx index 4fe81a91e..5ab03c07c 100644 --- a/packages/website/ts/index.tsx +++ b/packages/website/ts/index.tsx @@ -1,4 +1,5 @@ // Polyfills +import * as _ from 'lodash'; import { MuiThemeProvider } from 'material-ui/styles'; import * as React from 'react'; import { render } from 'react-dom'; @@ -14,6 +15,7 @@ import { Landing } from 'ts/containers/landing'; import { NotFound } from 'ts/containers/not_found'; import { Wiki } from 'ts/containers/wiki'; import { createLazyComponent } from 'ts/lazy_component'; +import { stateStorage } from 'ts/local_storage/state_storage'; import { trackedTokenStorage } from 'ts/local_storage/tracked_token_storage'; import { tradeHistoryStorage } from 'ts/local_storage/trade_history_storage'; import { reducer, State } from 'ts/redux/reducer'; @@ -75,7 +77,19 @@ const LazyOrderUtilsDocumentation = createLazyComponent('Documentation', async ( analytics.init(); // tslint:disable-next-line:no-floating-promises analytics.logProviderAsync((window as any).web3); -const store: ReduxStore<State> = createStore(reducer, devToolsEnhancer({ name: '0x Website Redux Store' })); +const store: ReduxStore<State> = createStore( + reducer, + stateStorage.getPersistedDefaultState(), + devToolsEnhancer({ name: '0x Website Redux Store' }), +); +store.subscribe( + _.throttle(() => { + stateStorage.saveState({ + hasPortalOnboardingBeenSeen: store.getState().hasPortalOnboardingBeenSeen, + }); + }, 1000), +); + render( <Router> <div> |