Skip to content

Commit

Permalink
fix(favicons): add missed file protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyurec committed Mar 9, 2023
1 parent 8b5851b commit 5e8f273
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 45 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"conventional-changelog-conventionalcommits": "^5.0.0",
"cz-conventional-changelog": "3.3.0",
"eslint": "^8.35.0",
Expand Down
80 changes: 40 additions & 40 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/modules/favIcons/favIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ const getFaviconData = async (url: string): Promise<favRecord> => {
src: await getBase64FromUrl(`https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://logseq.com&size=32`)
};
}
// local
if (protocol === 'file:') {
return favIcon = {
format: 'svg',
src: '<svg class="awLi-favicon" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path stroke="none" d="M0 0h24v24H0z"/><path d="M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"/></svg>'
};
}
// http - custom
if (hostname === 'youtu.be') {
return favIcon = {
Expand Down Expand Up @@ -232,7 +239,4 @@ export const faviconsLoad = async () => {
export const faviconsUnload = () => {
globals.favIconsCache.clear();
removeFavicons();
// if (!globalContext.pluginConfig.pageIconsEnabled && !globalContext.pluginConfig.faviconsEnabled) {
// stopLinksObserver();
// }
}

0 comments on commit 5e8f273

Please sign in to comment.