From cdd785abd1ef2bee17101f81234570497bc4fcae Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Fri, 23 Sep 2016 10:13:31 +0800 Subject: [PATCH] Autofill guid migration fix #4208, #4209 Auditors: @bridiver, @bbondy Test Plan: 1. Create autofill data from "0.12.1" and close brave 2. Copy "session-store-1" and "Web Data" to somewhere else 3. Copy the files in step 2 to your brave folder 4. Lauch brave "0.12.2" 5. Autofill data created from "0.12.1" should be listed in "about:autofill" 6. Should be able to add new autofill data --- app/sessionStore.js | 22 ++++++++++++++++++++++ js/components/frame.js | 1 - 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/sessionStore.js b/app/sessionStore.js index b86cafd190e..c11018b034a 100644 --- a/app/sessionStore.js +++ b/app/sessionStore.js @@ -341,6 +341,28 @@ module.exports.loadAppState = () => { }) data.autofill.creditCards = creditCards } + if (data.autofill.addresses.guid) { + let guids = [] + data.autofill.addresses.guid.forEach((guid) => { + if (typeof guid === 'object') { + guids.push(guid['persist:default']) + } else { + guids.push(guid) + } + }) + data.autofill.addresses.guid = guids + } + if (data.autofill.creditCards.guid) { + let guids = [] + data.autofill.creditCards.guid.forEach((guid) => { + if (typeof guid === 'object') { + guids.push(guid['persist:default']) + } else { + guids.push(guid) + } + }) + data.autofill.creditCards.guid = guids + } } // xml migration if (data.settings) { diff --git a/js/components/frame.js b/js/components/frame.js index acd2f2edddd..b8af2b080cf 100644 --- a/js/components/frame.js +++ b/js/components/frame.js @@ -119,7 +119,6 @@ class Frame extends ImmutableComponent { const guids = this.props.autofillAddresses.get('guid') let list = [] guids.forEach((entry) => { - console.log(entry) const address = currentWindow.webContents.session.autofill.getProfile(entry) const valid = Object.getOwnPropertyNames(address).length > 0 let addressDetail = {