diff --git a/js/about/aboutActions.js b/js/about/aboutActions.js index f490c7ed23b..9abe57ec505 100644 --- a/js/about/aboutActions.js +++ b/js/about/aboutActions.js @@ -196,11 +196,7 @@ const AboutActions = { * Open a adding address dialog */ addAutofillAddress: function () { - AboutActions.dispatchAction({ - actionType: WindowConstants.WINDOW_SET_AUTOFILL_ADDRESS_DETAIL, - currentDetail: {}, - originalDetail: {} - }) + ipc.sendToHost(messages.AUTOFILL_SET_ADDRESS, {}, {}) }, /** @@ -221,22 +217,15 @@ const AboutActions = { * @param {object} address - address to edit as per doc/state.md's autofillAddressDetail */ editAutofillAddress: function (address) { - AboutActions.dispatchAction({ - actionType: WindowConstants.WINDOW_SET_AUTOFILL_ADDRESS_DETAIL, - currentDetail: address, - originalDetail: address - }) + ipc.sendToHost(messages.AUTOFILL_SET_ADDRESS, address.toJS(), address.toJS()) }, /** * Open a adding credit card dialog */ addAutofillCreditCard: function () { - AboutActions.dispatchAction({ - actionType: WindowConstants.WINDOW_SET_AUTOFILL_CREDIT_CARD_DETAIL, - currentDetail: {month: '01', year: new Date().getFullYear().toString()}, - originalDetail: {} - }) + ipc.sendToHost(messages.AUTOFILL_SET_CREDIT_CARD, + {month: '01', year: new Date().getFullYear().toString()}, {}) }, /** @@ -257,11 +246,7 @@ const AboutActions = { * @param {object} card - credit card to edit as per doc/state.md's autofillCreditCardDetail */ editAutofillCreditCard: function (card) { - AboutActions.dispatchAction({ - actionType: WindowConstants.WINDOW_SET_AUTOFILL_CREDIT_CARD_DETAIL, - currentDetail: card, - originalDetail: card - }) + ipc.sendToHost(messages.AUTOFILL_SET_CREDIT_CARD, card.toJS(), card.toJS()) } } module.exports = AboutActions diff --git a/js/components/frame.js b/js/components/frame.js index e0cf9327ac5..96e3b411b5d 100644 --- a/js/components/frame.js +++ b/js/components/frame.js @@ -768,6 +768,14 @@ class Frame extends ImmutableComponent { method = (clearBrowsingDataDetail) => windowActions.setClearBrowsingDataDetail(clearBrowsingDataDetail) break + case messages.AUTOFILL_SET_ADDRESS: + method = (currentDetail, originalDetail) => + windowActions.setAutofillAddressDetail(currentDetail, originalDetail) + break + case messages.AUTOFILL_SET_CREDIT_CARD: + method = (currentDetail, originalDetail) => + windowActions.setAutofillCreditCardDetail(currentDetail, originalDetail) + break } method.apply(this, e.args) }) diff --git a/js/constants/messages.js b/js/constants/messages.js index 4d071b64087..87344ebd98a 100644 --- a/js/constants/messages.js +++ b/js/constants/messages.js @@ -126,6 +126,8 @@ const messages = { IMPORT_BROWSER_DATA_NOW: _, IMPORTER_LIST: _, // Autofill + AUTOFILL_SET_ADDRESS: _, + AUTOFILL_SET_CREDIT_CARD: _, AUTOFILL_ADDRESSES_UPDATED: _, AUTOFILL_CREDIT_CARDS_UPDATED: _, // HTTPS