2017-04-27 06:13:33 +00:00
|
|
|
import {
|
|
|
|
GENERATE_WALLET_SHOW_PASSWORD,
|
|
|
|
GENERATE_WALLET_FILE,
|
|
|
|
GENERATE_WALLET_HAS_DOWNLOADED_FILE,
|
|
|
|
GENERATE_WALLET_CONTINUE_TO_PAPER
|
|
|
|
|
2017-05-30 20:36:52 +00:00
|
|
|
} from 'actions/generateWallet';
|
2017-04-18 23:34:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
showPassword: false,
|
|
|
|
generateWalletFile: false,
|
2017-04-27 06:13:33 +00:00
|
|
|
hasDownloadedWalletFile: false,
|
|
|
|
canProceedToPaper: false
|
2017-04-18 23:34:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function generateWallet(state = initialState, action) {
|
|
|
|
switch (action.type) {
|
|
|
|
case GENERATE_WALLET_SHOW_PASSWORD: {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
showPassword: !state.showPassword
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
case GENERATE_WALLET_FILE: {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
generateWalletFile: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-27 06:13:33 +00:00
|
|
|
case GENERATE_WALLET_HAS_DOWNLOADED_FILE: {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
hasDownloadedWalletFile: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
case GENERATE_WALLET_CONTINUE_TO_PAPER: {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
canProceedToPaper: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-18 23:34:24 +00:00
|
|
|
default:
|
|
|
|
return state
|
|
|
|
}
|
|
|
|
}
|