Skip to content

Commit

Permalink
refactor: remove setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
TeeGoood committed Mar 30, 2024
1 parent f1cea8c commit 8e39be8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion apps/web/src/app/(screen)/screen/components/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface OverLayProps {
}

const Page = ({data} : OverLayProps) => {
console.log(data)
return (
<div className="w-full h-full bg-[#3dff3d] text-white text-3xl font-bold flex flex-col justify-between p-[50px]">
<div className="flex justify-between">
Expand Down
13 changes: 5 additions & 8 deletions apps/web/src/app/(screen)/screen/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@ const Screen = () => {
const [showedPage, setShowPage] = useState<"overlay" | "display">("overlay");
const [ data, setData ] = useState({
status: "waiting",
cu: 0,
tu: 0
cu: 50,
tu: 50
})
const cookies = new Cookies( null, { path: "/" } )
//console.log(data)
console.log(data)

useEffect(() => {
const handleConnect = (socket: Socket) => {
console.log('Client has connected to the server!');
setTimeout(() => {
console.log('Subscribing');
socket.emit('subscribe', '123');
console.log(data.status)
}, 3000);
console.log('Subscribing');
socket.emit('subscribe', '123');
};

const handleScoreBoard = (scoreString: string) => {
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/app/(user)/shake/[university]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function normalize(x: number, y: number, z: number) {

export default function Shake() {
let fid: string | null = null;
//let socket: Socket | null = null;
const cookies = new Cookies();
const [ socketState, setSocketState ] = useState<Socket | null>(null)

Expand Down

0 comments on commit 8e39be8

Please sign in to comment.