mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Handle siteNames for non url items
This commit is contained in:
parent
0ed6c5cf86
commit
6597245b9c
2 changed files with 10 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ import {
|
|||
MenuStyle,
|
||||
FLAIR_ICON_NAMES,
|
||||
} from './LibraryCardStyles'
|
||||
import { siteName } from '../../../lib/textFormatting'
|
||||
import { shouldHideUrl, siteName } from '../../../lib/textFormatting'
|
||||
import { sortedLabels } from '../../../lib/labelsSort'
|
||||
import { LIBRARY_LEFT_MENU_WIDTH } from '../../templates/navMenu/LibraryMenu'
|
||||
import { LibraryHoverActions } from './LibraryHoverActions'
|
||||
|
|
|
|||
|
|
@ -23,15 +23,22 @@ export const shouldHideUrl = (url: string): boolean => {
|
|||
return false
|
||||
}
|
||||
|
||||
const shouldHideSiteName = (siteName: string) => {
|
||||
const hideNames = ['storage.googleapis.com', 'omnivore.app']
|
||||
if (hideNames.indexOf(origin) != -1) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
export const siteName = (
|
||||
originalArticleUrl: string,
|
||||
itemUrl: string,
|
||||
siteName?: string
|
||||
): string => {
|
||||
if (siteName) {
|
||||
return shouldHideUrl(siteName) ? '' : siteName
|
||||
return shouldHideSiteName(siteName) ? '' : siteName
|
||||
}
|
||||
|
||||
if (shouldHideUrl(originalArticleUrl)) {
|
||||
return ''
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue