feat(desktop): resolve url with site url to make sure url is valid (#3511)

* feat(desktop): enhance entry actions and URL resolution with siteUrl support

* update

* update
This commit is contained in:
Konv Suu
2025-04-21 12:47:18 +08:00
committed by GitHub
parent fd74a0ed7e
commit 2bbb00c9fa
8 changed files with 93 additions and 67 deletions
+12
View File
@@ -186,6 +186,18 @@ export const parseSafeUrl = (url: string) => {
return null
}
}
/**
* @deprecated Remove it in the future but not now
*/
export const resolveUrlWithBase = (url: string, baseUrl: string) => {
try {
return new URL(url, baseUrl).href
} catch {
return url
}
}
export const getUrlIcon = (url: string, fallback?: boolean | undefined) => {
let src: string
let fallbackUrl = ""