diff --git a/frontend/src/Components/Deck.jsx b/frontend/src/Components/Deck.jsx index 65637c0..afa87b3 100644 --- a/frontend/src/Components/Deck.jsx +++ b/frontend/src/Components/Deck.jsx @@ -1,7 +1,7 @@ import { useEffect, useState,useRef } from "react"; import { useSelector, useDispatch } from "react-redux"; import { clickCard, setPendingReveal, revealLocal, resetAll, updateCardClickedBy } from "../store/slices/cardsSlice"; -import { showOverlay, hideOverlay, showClueDisplay, hideClueDisplay, toggleConfirmTarget, removeConfirmTarget, clearConfirmTargets } from "../store/slices/uiSlice"; +import { showOverlay, hideOverlay, showClueDisplay, hideClueDisplay, toggleConfirmTarget, clearConfirmTargets } from "../store/slices/uiSlice"; import { updatePlayers } from "../store/slices/playersSlice"; import { setCurrentTurn } from "../store/slices/gameSlice"; import socket from "../socket"; @@ -23,7 +23,6 @@ const Deck = () => { const { gameId } = useParams(); const cards = useSelector((state) => state.cards?.cards ?? []); const overlayActive = useSelector((state) => state.ui?.overlayActive ?? false); - const clueDisplayActive = useSelector((state) => state.ui?.clueDisplayActive ?? false); const lastClue = useSelector((state) => state.ui?.lastClue ?? null); const confirmTargetIds = useSelector((state) => state.ui?.confirmTargetIds ?? []); const currentTurn = useSelector((state) => state.game?.currentTurn ?? "red"); @@ -57,7 +56,6 @@ useEffect(() => { // clear the stored role and mark that we need to tell the server // this player should now be a spectator (so the players list updates). const prevTitle = localStorage.getItem('joinedTitle'); - const prevTeam = localStorage.getItem('joinedTeam'); if (prevTitle === 'Concealers') { console.log("🧹 Detected stale 'Concealers' on refresh — will update server to spectator after join"); needsSpectatorUpdate.current = true; diff --git a/frontend/src/Components/PlayerList.jsx b/frontend/src/Components/PlayerList.jsx index 981b50e..49b3df0 100644 --- a/frontend/src/Components/PlayerList.jsx +++ b/frontend/src/Components/PlayerList.jsx @@ -3,8 +3,8 @@ import { useContext } from "react"; const PlayerList = ({ team, title, players, colorClasses }) => { const { teamInfo, titleInfo, handleJoin } = useContext(JoinContext); - const [joinedTeam, setJoinedTeam] = teamInfo; - const [joinedTitle, setJoinedTitle] = titleInfo; + const [joinedTeam] = teamInfo; + const [joinedTitle] = titleInfo; // Whether the user already belongs to this exact team+title const isAlreadyJoined = joinedTeam === team && joinedTitle === title; diff --git a/frontend/src/Components/TeamPanel.jsx b/frontend/src/Components/TeamPanel.jsx index 399d1dc..258456d 100644 --- a/frontend/src/Components/TeamPanel.jsx +++ b/frontend/src/Components/TeamPanel.jsx @@ -1,6 +1,6 @@ import PlayerList from "./PlayerList"; -const TeamPanel = ({ team, score, concealers, revealers, joinFunction }) => { +const TeamPanel = ({ team, score, concealers, revealers }) => { const colorClasses = team === 'red' ? { bg: 'bg-red-500 dark:bg-red-700', diff --git a/frontend/src/store/slices/cardsSlice.js b/frontend/src/store/slices/cardsSlice.js index 1593bb1..7257eac 100644 --- a/frontend/src/store/slices/cardsSlice.js +++ b/frontend/src/store/slices/cardsSlice.js @@ -50,7 +50,7 @@ export const clickCard = createAsyncThunk( async ({ id, word, team, gameId }, { rejectWithValue }) => { try { // send the exact payload your server expects - const res = await axios.post(`${API_URL}/api/click`, { gameId, word }); + await axios.post(`${API_URL}/api/click`, { gameId, word }); // optionally use server response (res.data) if you want to sync board/scores socket.emit('sendMessage', { message: `${word} clicked`, team }); diff --git a/frontend/src/store/slices/clueInput.js b/frontend/src/store/slices/clueInput.js index ba2c084..e69de29 100644 --- a/frontend/src/store/slices/clueInput.js +++ b/frontend/src/store/slices/clueInput.js @@ -1,2 +0,0 @@ -import { createSlice } from "@reduxjs/toolkit"; -import socket from "../../socket"; \ No newline at end of file diff --git a/frontend/src/store/slices/scoreSlice.js b/frontend/src/store/slices/scoreSlice.js index 1d37a6a..bbbf732 100644 --- a/frontend/src/store/slices/scoreSlice.js +++ b/frontend/src/store/slices/scoreSlice.js @@ -1,5 +1,4 @@ import { createSlice } from "@reduxjs/toolkit"; -import axios from "axios"; const scoreSlice = createSlice({ name: "scores",