Skip to content

Commit

Permalink
Clear state if clear autofill data when shutdown.
Browse files Browse the repository at this point in the history
because we won't receive personal-data-changed on shutdown

fix brave#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
  • Loading branch information
darkdh committed Oct 15, 2016
1 parent b004c8a commit a2cec59
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/sessionStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a2cec59

Please sign in to comment.