Skip to content

Commit

Permalink
common: Also check using endsWith for host icon map
Browse files Browse the repository at this point in the history
  • Loading branch information
somnisomni committed Jan 24, 2025
1 parent abc7a6e commit 024bbfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/Common/src/utils/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export function getSimpleIconByUrl(href: string | URL): "mail" | SimpleIcon | nu
}

const host = url.hostname.replace(/^www(\d+)?\./, "");
if(host in hostIconMap) {
return hostIconMap[host];
if(host in hostIconMap || Object.keys(hostIconMap).some((key) => host.endsWith(key))) {
return hostIconMap[host] ?? hostIconMap[Object.keys(hostIconMap).find((key) => host.endsWith(key))!];
}

return null;
Expand Down

0 comments on commit 024bbfa

Please sign in to comment.