mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Handle empty email and subscription lists
This commit is contained in:
parent
2f8cdaec05
commit
02a31890fe
2 changed files with 6 additions and 0 deletions
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue