mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #4326 from omnivore-app/fix/web-non-urls-list
fix/web non urls list
This commit is contained in:
commit
aa5f50d52e
7 changed files with 18 additions and 13 deletions
|
|
@ -19,7 +19,10 @@ export function ArticleSubtitle(props: ArticleSubtitleProps): JSX.Element {
|
|||
return (
|
||||
<Box>
|
||||
<StyledText style={textStyle} css={{ wordBreak: 'break-word' }}>
|
||||
{subtitle} {subtitle && <span style={{ bottom: 1 }}>• </span>}{' '}
|
||||
{subtitle}{' '}
|
||||
{subtitle && !shouldHideUrl(props.href) && (
|
||||
<span style={{ bottom: 1 }}>• </span>
|
||||
)}{' '}
|
||||
{!props.hideButton && !shouldHideUrl(props.href) && (
|
||||
<>
|
||||
<StyledLink
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -119,16 +119,10 @@ export function LibraryContainer(props: LibraryContainerProps): JSX.Element {
|
|||
isFetchingNextPage,
|
||||
isFetching,
|
||||
fetchNextPage,
|
||||
fetchPreviousPage,
|
||||
hasNextPage,
|
||||
status,
|
||||
error: fetchItemsError,
|
||||
} = useGetLibraryItems(props.folder ?? 'home', props.folder, queryInputs)
|
||||
|
||||
console.log(
|
||||
`status ${status}, isLoading: ${isLoading}, isFetching: ${isFetching}`
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (queryValue.startsWith('#')) {
|
||||
debouncedFetchSearchResults(
|
||||
|
|
@ -163,7 +157,6 @@ export function LibraryContainer(props: LibraryContainerProps): JSX.Element {
|
|||
}, [router.asPath])
|
||||
|
||||
const libraryItems = useMemo(() => {
|
||||
console.log('library items: ', itemsPages)
|
||||
const items =
|
||||
itemsPages?.pages
|
||||
.flatMap((ad: LibraryItems) => {
|
||||
|
|
@ -1027,8 +1020,6 @@ export function LibraryItemsLayout(
|
|||
isSessionStorage: false,
|
||||
})
|
||||
|
||||
console.log('props.isValidating: ', props.isValidating)
|
||||
|
||||
return (
|
||||
<>
|
||||
<VStack
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ export const articleFragment = gql`
|
|||
description
|
||||
linkId
|
||||
state
|
||||
siteName
|
||||
wordsCount
|
||||
}
|
||||
`
|
||||
|
|
|
|||
|
|
@ -969,6 +969,7 @@ export type ArticleAttributes = {
|
|||
author?: string
|
||||
image?: string
|
||||
savedAt: string
|
||||
siteName?: string
|
||||
createdAt: string
|
||||
publishedAt?: string
|
||||
description?: string
|
||||
|
|
|
|||
|
|
@ -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(siteName) != -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 ''
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ export default function Debug(): JSX.Element {
|
|||
value: article.originalArticleUrl,
|
||||
})
|
||||
result.push({ name: 'author', value: article.author ?? 'null' })
|
||||
result.push({ name: 'siteName', value: article.siteName ?? 'null' })
|
||||
|
||||
result.push({ name: 'image', value: article.image ?? 'null' })
|
||||
result.push({ name: 'savedAt', value: article.savedAt })
|
||||
result.push({ name: 'createdAt', value: article.createdAt })
|
||||
|
|
|
|||
Loading…
Reference in a new issue