show failed_at timestamp if a feed failed to fresh

This commit is contained in:
Hongbo Wu
2024-04-05 17:26:38 +08:00
parent 61b3241b64
commit f8a6887d09
2 changed files with 13 additions and 4 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,10 +229,17 @@ export default function Rss(): JSX.Element {
}}
>
<SpanBox>{`URL: ${subscription.url}`}</SpanBox>
<SpanBox>{`Last refreshed: ${
subscription.lastFetchedAt
? formattedDateTime(subscription.lastFetchedAt)
: 'Never'
{/* show failed timestamp instead of last refreshed timestamp if the feed failed to refresh */}
<SpanBox>{`${
subscription.failedAt
? `Failed to refresh: ${formattedDateTime(
subscription.failedAt
)}`
: `Last refreshed: ${
subscription.lastFetchedAt
? formattedDateTime(subscription.lastFetchedAt)
: 'Never'
}`
}`}</SpanBox>
<SpanBox>
{subscription.mostRecentItemDate &&