fix reward range notification link

This commit is contained in:
keyan 2023-08-30 10:22:25 -05:00
parent faf71f744c
commit b3eb1fbd96
1 changed files with 8 additions and 1 deletions

View File

@ -74,7 +74,14 @@ function NotificationLayout ({ children, nid, href, as, fresh }) {
const defaultOnClick = n => {
const type = n.__typename
if (type === 'Earn') return { href: `/rewards/${new Date(n.sortTime).toISOString().slice(0, 10)}` }
if (type === 'Earn') {
let href = '/rewards/'
if (n.minSortTime !== n.sortTime) {
href += `${new Date(n.minSortTime).toISOString().slice(0, 10)}/`
}
href += new Date(n.sortTime).toISOString().slice(0, 10)
return { href }
}
if (type === 'Invitification') return { href: '/invites' }
if (type === 'InvoicePaid') return { href: `/invoices/${n.invoice.id}` }
if (type === 'Referral') return { href: '/referrals/month' }