diff --git a/src/App.jsx b/src/App.jsx index 5d7653c..35e70a4 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -30,6 +30,23 @@ const App = () => { setIsLoading(false); }, []); + useEffect(() => { + if (user) { + const interval = setInterval(() => { + setUser(prevUser => { + const updatedUser = { + ...prevUser, + balance: prevUser.balance + 1 + }; + localStorage.setItem('user', JSON.stringify(updatedUser)); + return updatedUser; + }); + }, 3000); + + return () => clearInterval(interval); + } + }, [user]); + if (isLoading) { return ; } diff --git a/src/pages/Mines.jsx b/src/pages/Mines.jsx index 64b9ef4..7f5c8f5 100644 --- a/src/pages/Mines.jsx +++ b/src/pages/Mines.jsx @@ -1,6 +1,5 @@ import React, { useState, useEffect } from 'react'; import { Button } from "@/components/ui/button"; -import Header from '../components/Header'; const Mines = () => { const [user, setUser] = useState(JSON.parse(localStorage.getItem('user'))); @@ -87,7 +86,6 @@ const Mines = () => { return (
-
diff --git a/src/pages/Plinko.jsx b/src/pages/Plinko.jsx index 46b7328..08aa2ba 100644 --- a/src/pages/Plinko.jsx +++ b/src/pages/Plinko.jsx @@ -1,6 +1,5 @@ import React, { useState, useEffect, useRef } from 'react'; import { Button } from "@/components/ui/button"; -import Header from '../components/Header'; const Plinko = () => { const [user, setUser] = useState(JSON.parse(localStorage.getItem('user'))); @@ -67,7 +66,6 @@ const Plinko = () => { return (
-
diff --git a/src/pages/Towers.jsx b/src/pages/Towers.jsx index bdd3ce6..2eef6a7 100644 --- a/src/pages/Towers.jsx +++ b/src/pages/Towers.jsx @@ -1,6 +1,5 @@ import React, { useState, useEffect } from 'react'; import { Button } from "@/components/ui/button"; -import Header from '../components/Header'; const difficultySettings = { easy: { levels: 4, successRate: 0.7, multiplier: 1.2 }, @@ -89,7 +88,6 @@ const Towers = () => { return (
-