Skip to content

Commit

Permalink
chore: cleanup createdTimeAgo logic (denoland#605)
Browse files Browse the repository at this point in the history
A recent database migration means this logic is no longer needed.
  • Loading branch information
iuioiua authored Sep 22, 2023
1 parent 380bc54 commit d61f683
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions islands/ItemsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,6 @@ interface ItemSummaryProps {
}

function ItemSummary(props: ItemSummaryProps) {
let createdTimeAgo: string;

try {
createdTimeAgo = timeAgo(new Date(decodeTime(props.item.id)));
} catch (err) {
// @ts-ignore old items, which still have a `uuid`, also have a `createdAt` property
createdTimeAgo = timeAgo(new Date(props.item?.createdAt));
}

return (
<div class="py-2 flex gap-4">
{props.isSignedIn
Expand Down Expand Up @@ -147,7 +138,7 @@ function ItemSummary(props: ItemSummaryProps) {
<a class="hover:underline" href={`/users/${props.item.userLogin}`}>
{props.item.userLogin}
</a>{" "}
{createdTimeAgo}
{timeAgo(new Date(decodeTime(props.item.id)))}
</p>
</div>
</div>
Expand Down

0 comments on commit d61f683

Please sign in to comment.