Merge pull request #1668 from omnivore-app/fix/email-validating
Mark emails as validating if no data returned
This commit is contained in:
@ -64,7 +64,7 @@ export function useGetNewsletterEmailsQuery(): NewsletterEmailsQueryResponse {
|
||||
console.log('error', error)
|
||||
}
|
||||
return {
|
||||
isValidating: false,
|
||||
isValidating: true,
|
||||
emailAddresses: [],
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
revalidate: () => {},
|
||||
|
||||
@ -107,6 +107,9 @@ export default function EmailsPage(): JSX.Element {
|
||||
}
|
||||
|
||||
const sortedEmailAddresses = useMemo(() => {
|
||||
if (!emailAddresses) {
|
||||
return []
|
||||
}
|
||||
return emailAddresses.sort((a, b) => a.createdAt.localeCompare(b.createdAt))
|
||||
}, [emailAddresses])
|
||||
|
||||
@ -134,6 +137,9 @@ export default function EmailsPage(): JSX.Element {
|
||||
css={{
|
||||
my: '5px',
|
||||
fontSize: '11px',
|
||||
a: {
|
||||
color: '$omnivoreCtaYellow',
|
||||
},
|
||||
}}
|
||||
>
|
||||
{`created ${formattedShortDate(email.createdAt)}, `}
|
||||
|
||||
@ -31,6 +31,9 @@ export default function SubscriptionsPage(): JSX.Element {
|
||||
}
|
||||
|
||||
const sortedSubscriptions = useMemo(() => {
|
||||
if (!subscriptions) {
|
||||
return []
|
||||
}
|
||||
return subscriptions.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt))
|
||||
}, [subscriptions])
|
||||
|
||||
@ -56,6 +59,9 @@ export default function SubscriptionsPage(): JSX.Element {
|
||||
css={{
|
||||
my: '5px',
|
||||
fontSize: '11px',
|
||||
a: {
|
||||
color: '$omnivoreCtaYellow',
|
||||
},
|
||||
}}
|
||||
>
|
||||
{`Last received ${formattedShortDate(
|
||||
|
||||
Reference in New Issue
Block a user