mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-22 23:23:54 +08:00
fix(autoload-images): Check to see if whitelist exists
This commit is contained in:
parent
d057e5f67b
commit
369c5049a7
1 changed files with 7 additions and 5 deletions
|
@ -30,11 +30,13 @@ class AutoloadImagesStore extends NylasStore
|
|||
true
|
||||
|
||||
_loadWhitelist: =>
|
||||
fs.readFile @_whitelistEmailsPath, (err, body) =>
|
||||
return console.log(err) if err or not body
|
||||
@_whitelistEmails = {}
|
||||
for email in body.toString().split(/[\n\r]+/)
|
||||
@_whitelistEmails[Utils.toEquivalentEmailForm(email)] = true
|
||||
fs.exists @_whitelistEmailsPath, (exists) =>
|
||||
return unless exists
|
||||
fs.readFile @_whitelistEmailsPath, (err, body) =>
|
||||
return console.log(err) if err or not body
|
||||
@_whitelistEmails = {}
|
||||
for email in body.toString().split(/[\n\r]+/)
|
||||
@_whitelistEmails[Utils.toEquivalentEmailForm(email)] = true
|
||||
|
||||
_saveWhitelist: =>
|
||||
data = Object.keys(@_whitelistEmails).join('\n')
|
||||
|
|
Loading…
Reference in a new issue