fix(desktop): update EntryTitle to handle localhost url (#3389)

This commit is contained in:
Konv Suu 2025-04-02 23:09:36 +08:00 committed by GitHub
parent 48b18c20b6
commit b1069e4681
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -38,7 +38,12 @@ export const EntryTitle = ({ entryId, compact }: EntryLinkProps) => {
const href = entry?.entries.url
if (!href) return "#"
if (href.startsWith("http")) return href
if (href.startsWith("http")) {
const domain = new URL(href).hostname
if (domain === "localhost") return "#"
return href
}
const feedSiteUrl = feed?.type === "feed" ? feed.siteUrl : null
if (href.startsWith("/") && feedSiteUrl) return safeUrl(href, feedSiteUrl)
return href