Save receive address in localStorage to prevent new receive address creation on

every boot
This commit is contained in:
6ea86b96 2017-05-07 16:17:38 +07:00
parent 58c06e17c9
commit e08419e534
No known key found for this signature in database
GPG key ID: B282D183E4931E8F

View file

@ -1,7 +1,7 @@
import * as types from 'constants/action_types'
const reducers = {}
const address = sessionStorage.getItem('receiveAddress')
const address = localStorage.getItem('receiveAddress')
const buildDraftTransaction = () => ({
amount: undefined,
address: undefined
@ -50,7 +50,7 @@ reducers[types.GET_NEW_ADDRESS_STARTED] = function(state, action) {
reducers[types.GET_NEW_ADDRESS_COMPLETED] = function(state, action) {
const { address } = action.data
sessionStorage.setItem('receiveAddress', address)
localStorage.setItem('receiveAddress', address)
return Object.assign({}, state, {
gettingNewAddress: false,
receiveAddress: address