mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Show unable to parse if page is failed to save within 30 seconds
This commit is contained in:
parent
fb96265a00
commit
80d0146f72
3 changed files with 7 additions and 4 deletions
|
|
@ -102,7 +102,7 @@ const FORCE_PUPPETEER_URLS = [
|
|||
/twitter\.com\/(?:#!\/)?(\w+)\/status(?:es)?\/(\d+)(?:\/.*)?/,
|
||||
/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,
|
||||
]
|
||||
const UNPARSEABLE_CONTENT = 'We were unable to parse this page.'
|
||||
const UNPARSEABLE_CONTENT = '<p>We were unable to parse this page.</p>'
|
||||
|
||||
export type CreateArticlesSuccessPartial = Merge<
|
||||
CreateArticleSuccess,
|
||||
|
|
@ -434,7 +434,7 @@ export const getArticleResolver: ResolverFn<
|
|||
|
||||
if (
|
||||
page.state === ArticleSavingRequestStatus.Processing &&
|
||||
new Date(page.createdAt).getTime() < new Date().getTime() - 1000 * 60
|
||||
new Date(page.createdAt).getTime() < new Date().getTime() - 1000 * 30
|
||||
) {
|
||||
page.content = UNPARSEABLE_CONTENT
|
||||
page.description = UNPARSEABLE_CONTENT
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@ export const createPageSaveRequest = async (
|
|||
const existingPage = await getPageByParam({
|
||||
userId,
|
||||
url,
|
||||
state: ArticleSavingRequestStatus.Succeeded,
|
||||
})
|
||||
if (existingPage) {
|
||||
console.log('Page already exists', url)
|
||||
|
|
|
|||
|
|
@ -259,7 +259,11 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element {
|
|||
const username = viewerData?.me?.profile.username
|
||||
if (username) {
|
||||
setActiveCardId(item.node.id)
|
||||
if (item.node.state === State.PROCESSING) {
|
||||
if (
|
||||
item.node.state === State.PROCESSING &&
|
||||
new Date(item.node.createdAt).getTime() >=
|
||||
new Date().getTime() - 1000 * 30
|
||||
) {
|
||||
router.push(`/${username}/links/${item.node.id}`)
|
||||
} else {
|
||||
router.push(`/${username}/${item.node.slug}`)
|
||||
|
|
|
|||
Loading…
Reference in a new issue