diff --git a/app/reducers/form.js b/app/reducers/form.js index 91bb4d4b..b91610bf 100644 --- a/app/reducers/form.js +++ b/app/reducers/form.js @@ -2,6 +2,7 @@ const initialState = { modalOpen: true, formType: 'pay', + paymentType: 'onchain', amount: '0', message: '', pubkey: '', @@ -14,6 +15,7 @@ export const SET_FORM = 'SET_FORM' export const SET_AMOUNT = 'SET_AMOUNT' export const SET_MESSAGE = 'SET_MESSAGE' export const SET_PUBKEY = 'SET_PUBKEY' +export const SET_PAYMENT_TYPE = 'SET_PAYMENT_TYPE' export const SET_PAYMENT_REQUEST = 'SET_PAYMENT_REQUEST' export const RESET_FORM = 'RESET_FORM' @@ -28,6 +30,13 @@ export function setForm({ modalOpen, formType }) { } } +export function setPaymentType(paymentType) { + return { + type: SET_PAYMENT_TYPE, + paymentType + } +} + export function setAmount(amount) { return { type: SET_AMOUNT, @@ -70,6 +79,7 @@ const ACTION_HANDLERS = { [SET_AMOUNT]: (state, { amount }) => ({ ...state, amount }), [SET_MESSAGE]: (state, { message }) => ({ ...state, message }), [SET_PUBKEY]: (state, { pubkey }) => ({ ...state, pubkey }), + [SET_PAYMENT_TYPE]: (state, { paymentType }) => ({ ...state, paymentType }), [SET_PAYMENT_REQUEST]: (state, { payment_request }) => ({ ...state, payment_request }), [RESET_FORM]: () => (initialState) } diff --git a/app/routes/app/components/App.js b/app/routes/app/components/App.js index 3a51c121..9bb35803 100644 --- a/app/routes/app/components/App.js +++ b/app/routes/app/components/App.js @@ -27,6 +27,7 @@ class App extends Component { peers, setCurrency, setForm, + setPaymentType, createInvoice, payInvoice, fetchInvoice, @@ -41,6 +42,7 @@ class App extends Component {