fix: handle nullable expiry values from a db

This commit is contained in:
Aarnav Tale 2024-10-10 10:06:52 -04:00
parent dd479d4117
commit d165264876
No known key found for this signature in database
3 changed files with 8 additions and 2 deletions

View file

@ -29,6 +29,7 @@ export default function Menu({ machine, routes, magic, users }: MenuProps) {
const expired = machine.expiry === '0001-01-01 00:00:00'
|| machine.expiry === '0001-01-01T00:00:00Z'
|| machine.expiry === null
? false
: new Date(machine.expiry).getTime() < Date.now()