mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 02:55:29 +00:00
fix(TypeError): Failed to construct 'URL': Invalid base URL
This commit is contained in:
@@ -110,8 +110,13 @@ export function getFormulaTextSegments(anchorLinkHTML: string) {
|
||||
}
|
||||
|
||||
export const openLink = (path: string, baseURL?: string, target = '_blank') => {
|
||||
const url = new URL(path, baseURL)
|
||||
window.open(url.href, target, 'noopener,noreferrer')
|
||||
try {
|
||||
const url = new URL(path, baseURL)
|
||||
window.open(url.href, target, 'noopener,noreferrer')
|
||||
} catch (e) {
|
||||
console.error(`Failed constructing URL'${path}'`, e)
|
||||
message.error((e as Error)?.message || 'Failed to construct URL')
|
||||
}
|
||||
}
|
||||
|
||||
export const navigateToBlankTargetOpenOption = {
|
||||
|
||||
Reference in New Issue
Block a user