diff --git a/app/routes/_data.machines.$id.tsx b/app/routes/_data.machines.$id.tsx index c078f09..f6ff1d0 100644 --- a/app/routes/_data.machines.$id.tsx +++ b/app/routes/_data.machines.$id.tsx @@ -56,6 +56,7 @@ export default function Page() { 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() @@ -134,7 +135,10 @@ export default function Page() { /> {magic ? ( diff --git a/app/routes/_data.machines._index/machine.tsx b/app/routes/_data.machines._index/machine.tsx index 7be5a02..2836432 100644 --- a/app/routes/_data.machines._index/machine.tsx +++ b/app/routes/_data.machines._index/machine.tsx @@ -4,7 +4,7 @@ import { Link } from '@remix-run/react' import Menu from '~/components/Menu' import StatusCircle from '~/components/StatusCircle' import { toast } from '~/components/Toaster' -import { type Machine, type Route, User } from '~/types' +import { Machine, Route, User } from '~/types' import { cn } from '~/utils/cn' import MenuOptions from './menu' @@ -19,6 +19,7 @@ interface Props { export default function MachineRow({ machine, routes, magic, users }: Props) { 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() diff --git a/app/routes/_data.machines._index/menu.tsx b/app/routes/_data.machines._index/menu.tsx index eb0bffe..0f32844 100644 --- a/app/routes/_data.machines._index/menu.tsx +++ b/app/routes/_data.machines._index/menu.tsx @@ -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()