[tor-commits] [tor-browser] 249/311: Bug 1747898 - P2. Fix issues in `promptToSaveCreditCard` r=sgalich, tgiles a=dmeehan

gitolite role git at cupani.torproject.org
Tue Apr 26 15:30:49 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit d7b021492d73d8357dc48ec77f259aacfcdb0854
Author: Dimi <dlee at mozilla.com>
AuthorDate: Tue Mar 22 21:21:07 2022 +0000

    Bug 1747898 - P2. Fix issues in `promptToSaveCreditCard` r=sgalich,tgiles a=dmeehan
    
    There are two bugs in promptToSaveCreditCard
    1. `newCreditCard` doesn't contain `record` memeber variable
    2. `creditCard.record` should use `cc-name`, `cc-number`, etc to access
       data instead of `record.name`, `record.number`
    
    Differential Revision: https://phabricator.services.mozilla.com/D141767
---
 .../components/formautofill/android/FormAutofillPrompter.jsm | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/toolkit/components/formautofill/android/FormAutofillPrompter.jsm b/toolkit/components/formautofill/android/FormAutofillPrompter.jsm
index c94dce7064301..fff633d5a70a3 100644
--- a/toolkit/components/formautofill/android/FormAutofillPrompter.jsm
+++ b/toolkit/components/formautofill/android/FormAutofillPrompter.jsm
@@ -49,19 +49,13 @@ let FormAutofillPrompter = {
     let newCreditCard;
     if (creditCard.guid) {
       let originalCCData = await storage.creditCards.get(creditCard.guid);
-
-      newCreditCard = CreditCard.fromGecko(originalCCData || creditCard.record);
-      newCreditCard.record.name = creditCard.record.name;
-      newCreditCard.record.number = creditCard.record.number;
-      newCreditCard.record.expMonth = creditCard.record.expMonth;
-      newCreditCard.record.expYear = creditCard.record.expYear;
-      newCreditCard.record.type = creditCard.record.type;
+      newCreditCard = { ...originalCCData, ...creditCard.record };
     } else {
-      newCreditCard = creditCard;
+      newCreditCard = creditCard.record;
     }
 
     prompt.asyncShowPrompt(
-      this._createMessage([CreditCard.fromGecko(newCreditCard.record)]),
+      this._createMessage([CreditCard.fromGecko(newCreditCard)]),
       result => {
         const selectedCreditCard = result?.selection?.value;
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list