Skip to content

Commit

Permalink
feat: use formatDistanceStrict instead
Browse files Browse the repository at this point in the history
  • Loading branch information
cubedhuang committed Oct 3, 2022
1 parent 930fc68 commit b191c88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Discord.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import formatDistance from "date-fns/formatDistance";
import formatDistanceStrict from "date-fns/formatDistanceStrict";
import Image from "next/future/image";
import { useEffect, useState } from "preact/hooks";
import { Activity, useLanyard } from "react-use-lanyard";
Expand Down Expand Up @@ -117,7 +117,7 @@ function OtherActivities({ activities }: OtherActivitiesProps) {
useEffect(() => {
const interval = setInterval(() => {
setNow(new Date());
}, 5000);
}, 1000);

return () => clearInterval(interval);
}, []);
Expand All @@ -132,7 +132,7 @@ function OtherActivities({ activities }: OtherActivitiesProps) {
{activity.name}{" "}
<span className="opacity-80">
for{" "}
{formatDistance(
{formatDistanceStrict(
now,
activity.timestamps?.start ?? activity.created_at
)}
Expand Down

1 comment on commit b191c88

@vercel
Copy link

@vercel vercel bot commented on b191c88 Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

danonl – ./

danonl-git-main-cubed.vercel.app
danonl-cubed.vercel.app
dannext.vercel.app
dan.onl
www.dan.onl

Please sign in to comment.