Skip to content

Commit 9169122

Browse files
committed
Switch to WebSocket-based Lanyard hook
Use `useLanyardWS` for real-time updates instead of the polling version.
1 parent 4ecc847 commit 9169122

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/DiscordStatus.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect, useMemo } from "react";
2-
import { useLanyard } from "use-lanyard";
2+
import { useLanyardWS } from "use-lanyard";
33
import { useAutoAnimate } from "@formkit/auto-animate/react";
44
import rawGames from "../assets/gameList.json";
55

@@ -27,7 +27,7 @@ const LanyardStatus = () => {
2727
const [visible, setVisible] = useState(false);
2828
const [currentTime, setCurrentTime] = useState(new Date().getTime());
2929

30-
const { data: status } = useLanyard("342874998375186432");
30+
const status = useLanyardWS("342874998375186432");
3131

3232
useEffect(() => {
3333
const timer = setTimeout(() => setVisible(true), 500);

0 commit comments

Comments
 (0)