From a2cec59262b61db1430c69b9e8149761d3f9a5f5 Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Sat, 15 Oct 2016 15:00:22 -0400 Subject: [PATCH] Clear state if clear autofill data when shutdown. because we won't receive personal-data-changed on shutdown fix #4818 Auditors: @bridiver Test Plan: 1. Add autofill data entries in about:autofill 2. Turn on clear "Autofill data" when closing brave in about:preferences#security 3. Restart brave 4. There shouldn't be anything left in about:autofill --- app/sessionStore.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/sessionStore.js b/app/sessionStore.js index 8dee3049518..3309bf64b44 100644 --- a/app/sessionStore.js +++ b/app/sessionStore.js @@ -252,6 +252,11 @@ module.exports.cleanAppData = (data, isShutdown) => { const clearAutofillData = isShutdown && getSetting(settings.SHUTDOWN_CLEAR_AUTOFILL_DATA) === true if (clearAutofillData) { autofill.clearAutofillData() + const date = new Date().getTime() + data.autofill.addresses.guid = [] + data.autofill.addresses.timestamp = date + data.autofill.creditCards.guid = [] + data.autofill.creditCards.timestamp = date } const clearSiteSettings = isShutdown && getSetting(settings.SHUTDOWN_CLEAR_SITE_SETTINGS) === true if (clearSiteSettings) {