diff --git a/src/components/Hero.jsx b/src/components/Hero.jsx index a41ccf6..f901bc1 100644 --- a/src/components/Hero.jsx +++ b/src/components/Hero.jsx @@ -14,13 +14,15 @@ import Arrow from '../img/arrow_right.png'; export function Hero(props) { const contractAddress = props.contractAddress; + const { isConnected, address } = useAccount(); + const [tokensMinted, setTokensMinted] = useState(() => { - const saved = localStorage.getItem('tokensMinted-v1'); + const saved = localStorage.getItem('tokensMinted-v2-' + address); return saved || JSON.stringify([]) }); useEffect(() => { - localStorage.setItem('tokensMinted-v1', tokensMinted); + localStorage.setItem('tokensMinted-v2-' + address, tokensMinted); }, [tokensMinted]); const [options, setOptions] = useState({ @@ -52,7 +54,6 @@ export function Hero(props) { function handleStateChange(obj) { setOptions(preState => ({...preState , ...obj})); } - const { isConnected, address } = useAccount(); const defOpt = { address: contractAddress, abi: MainABI, @@ -313,6 +314,7 @@ export function Hero(props) {
{isConnected && options.unaboomersKilled < options.unaboomerMaxSupply - options.unaboomerMaxSurvivorCount + && options.bombBalance > 0 && ( <> { @@ -327,10 +329,24 @@ export function Hero(props) {(tx fee)
> - ) + ) || options.bombBalance == 0 &&