hiding tutorial when checked once
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2024-10-24 14:38:46 +02:00
parent 16beb9edb7
commit 4f757ec1e7
2 changed files with 5 additions and 1 deletions

View File

@ -23,6 +23,8 @@ export default function Tutorials() {
document.querySelector("dialog").scrollTo(0, 0); document.querySelector("dialog").scrollTo(0, 0);
} }
function startGame() { function startGame() {
localStorage.setItem("hasAlreadyCheckedTutorial", true);
setIsTimeRuning(true); setIsTimeRuning(true);
setHasCheckedTutorial(true); setHasCheckedTutorial(true);
} }

View File

@ -11,6 +11,8 @@ export const GameContext = createContext();
export function GameContextProvider({ children }) { export function GameContextProvider({ children }) {
const navigate = useNavigate(); const navigate = useNavigate();
const hasAlreadyCheckedTutorial = localStorage.getItem("hasAlreadyCheckedTutorial") || false;
const { language, country } = useUser(); const { language, country } = useUser();
// ##### DATA ##### // ##### DATA #####
@ -23,7 +25,7 @@ export function GameContextProvider({ children }) {
const [remainingQuestionsAmount, setRemainingQuestionsAmount] = useState(null); const [remainingQuestionsAmount, setRemainingQuestionsAmount] = useState(null);
// ##### INTERFACE ##### // ##### INTERFACE #####
const [hasCheckedTutorial, setHasCheckedTutorial] = useState(false); const [hasCheckedTutorial, setHasCheckedTutorial] = useState(hasAlreadyCheckedTutorial);
const [currentGameModal, setCurrentGameModal] = useState(null); const [currentGameModal, setCurrentGameModal] = useState(null);
const [isSoundOn, setIsSoundOn] = useState(true); const [isSoundOn, setIsSoundOn] = useState(true);