This commit is contained in:
diced 2022-10-28 16:46:53 -07:00
parent a9defd67d6
commit b30b7b1bd3
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1
3 changed files with 6 additions and 2 deletions

View file

@ -128,13 +128,13 @@ export default function File({ image, updateImages, disableMediaPreview }) {
<Stack>
<FileMeta Icon={FileIcon} title='Name' subtitle={image.file} />
<FileMeta Icon={ImageIcon} title='Type' subtitle={image.mimetype} />
<FileMeta Icon={EyeIcon} title='Views' subtitle={image.views.toLocaleString()} />
<FileMeta Icon={EyeIcon} title='Views' subtitle={image?.views?.toLocaleString()} />
{image.maxViews && (
<FileMeta
Icon={EyeIcon}
title='Max views'
subtitle={image.maxViews.toLocaleString()}
tooltip={`This file will be deleted after being viewed ${image.maxViews.toLocaleString()} times.`}
tooltip={`This file will be deleted after being viewed ${image?.maxViews?.toLocaleString()} times.`}
/>
)}
<FileMeta

View file

@ -23,6 +23,8 @@ async function handler(req: NextApiReq, res: NextApiRes) {
file: true,
mimetype: true,
id: true,
views: true,
maxViews: true,
},
});

View file

@ -29,6 +29,8 @@ async function handler(req: NextApiReq, res: NextApiRes) {
id: true,
destination: true,
vanity: true,
views: true,
maxViews: true,
},
});