mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Handle invalid URLs in the shouldHideUrl check
This commit is contained in:
parent
42a4f22c4b
commit
9fde7c98a4
1 changed files with 8 additions and 4 deletions
|
|
@ -5,10 +5,14 @@ import { HighlightItemCard } from './HighlightItemCard'
|
|||
import { PageType } from '../../../lib/networking/fragments/articleFragment'
|
||||
|
||||
const shouldHideUrl = (url: string): boolean => {
|
||||
const origin = new URL(url).origin
|
||||
const hideHosts = ['https://storage.googleapis.com', 'https://omnivore.app']
|
||||
if (hideHosts.indexOf(origin) != -1) {
|
||||
return true
|
||||
try {
|
||||
const origin = new URL(url).origin
|
||||
const hideHosts = ['https://storage.googleapis.com', 'https://omnivore.app']
|
||||
if (hideHosts.indexOf(origin) != -1) {
|
||||
return true
|
||||
}
|
||||
} catch {
|
||||
console.log('invalid url item', url)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue