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 #4930 from darkdh/4882
Browse files Browse the repository at this point in the history
Import favicon fix:
  • Loading branch information
bbondy authored Oct 19, 2016
2 parents b706100 + d804e39 commit 40de91d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,21 @@ importer.on('add-bookmarks', (e, bookmarks, topLevelFolder) => {
importer.on('add-favicons', (e, detail) => {
let faviconMap = {}
detail.forEach((entry) => {
if (entry.favicon_url.startsWith('made-up-favicon:')) {
faviconMap[entry.urls[0]] = entry.png_data
if (entry.favicon_url.includes('made-up-favicon')) {
for (let url of entry.urls) {
faviconMap[url] = entry.png_data
}
} else {
faviconMap[entry.urls[0]] = entry.favicon_url
for (let url of entry.urls) {
faviconMap[url] = 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) {
if ((site.get('favicon') === undefined && site.get('location') !== undefined &&
faviconMap[site.get('location')] !== undefined) ||
(site.get('favicon') !== undefined && site.get('favicon').includes('made-up-favicon'))) {
return site.set('favicon', faviconMap[site.get('location')])
} else {
return site
Expand Down

0 comments on commit 40de91d

Please sign in to comment.