Handle siteNames for non url items
This commit is contained in:
@ -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 ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user