Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #4271 from darkdh/4270
Browse files Browse the repository at this point in the history
Update favicon from importer
  • Loading branch information
bbondy authored Sep 26, 2016
2 parents c95cef9 + 2520fe3 commit 17256bf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,20 @@ importer.on('add-bookmarks', (e, bookmarks, topLevelFolder) => {
})

importer.on('add-favicons', (e, detail) => {
let faviconMap = {}
detail.forEach((entry) => {
faviconMap[entry.urls[0]] = entry.favicon_url
})
let sites = AppStore.getState().get('sites')
sites = sites.map((site) => {
if (site.get('favicon') === undefined && site.get('location') !== undefined &&
faviconMap[site.get('location')] !== undefined) {
return site.set('favicon', faviconMap[site.get('location')])
} else {
return site
}
})
appActions.addSite(sites)
})

importer.on('add-keywords', (e, templateUrls, uniqueOnHostAndPath) => {
Expand Down

0 comments on commit 17256bf

Please sign in to comment.