1 export const clear = () => {
5 // Local storage is not available.
9 export const exportState = (store) => () => {
10 const state = store.getState()
13 clientToken: (state.core || {}).clientToken,
15 // TODO: If the dashboard has a way of probing the core for a token
16 // requirement, we won't need to store these anymore.
17 requireClientToken: (state.core || {}).requireClientToken,
18 validToken: (state.core || {}).validToken,
19 btmAmountUnit: state.core.btmAmountUnit,
22 navAdvancedState : state.app.navAdvancedState,
25 generated: (state.transaction || {}).generated,
27 tutorial: state.tutorial
31 localStorage.setItem('reduxState', JSON.stringify(exportable))
32 } catch (err) { /* localstorage not available */ }
35 export const importState = () => {
38 state = localStorage.getItem('reduxState')
39 } catch (err) { /* localstorage not available */ }
44 return JSON.parse(state)