Merge pull request #3792 from omnivore-app/fix/feed_failed_at

show failed_at timestamp if a feed failed to fresh
This commit is contained in:
Hongbo Wu 2024-04-08 17:46:27 +08:00 committed by GitHub
commit bc0e38f44a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 5 deletions

View file

@ -30,6 +30,7 @@ export type Subscription = {
updatedAt: string
lastFetchedAt?: string
mostRecentItemDate?: string
failedAt?: string
fetchContentType?: FetchContentType
}
@ -74,6 +75,7 @@ export function useGetSubscriptionsQuery(
lastFetchedAt
fetchContentType
mostRecentItemDate
failedAt
}
}
... on SubscriptionsError {

View file

@ -229,11 +229,20 @@ export default function Rss(): JSX.Element {
}}
>
<SpanBox>{`URL: ${subscription.url}`}</SpanBox>
<SpanBox>{`Last refreshed: ${
subscription.lastFetchedAt
? formattedDateTime(subscription.lastFetchedAt)
: 'Never'
}`}</SpanBox>
{/* show failed timestamp instead of last refreshed timestamp if the feed failed to refresh */}
{subscription.failedAt ? (
<SpanBox
css={{ color: 'red' }}
>{`Failed to refresh: ${formattedDateTime(
subscription.failedAt
)}`}</SpanBox>
) : (
<SpanBox>{`Last refreshed: ${
subscription.lastFetchedAt
? formattedDateTime(subscription.lastFetchedAt)
: 'Never'
}`}</SpanBox>
)}
<SpanBox>
{subscription.mostRecentItemDate &&
`Most recent item: ${formattedDateTime(