From 6c342bd4ba17173dd57f164ee35a4ccee7cce45e Mon Sep 17 00:00:00 2001 From: GottliebGlob Date: Sat, 6 Aug 2022 00:29:20 +0300 Subject: [PATCH] Refresh CM fix --- .env.example | 14 -------------- src/Home.tsx | 13 ++++++++++++- 2 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 .env.example diff --git a/.env.example b/.env.example deleted file mode 100644 index 9c73a6d..0000000 --- a/.env.example +++ /dev/null @@ -1,14 +0,0 @@ -REACT_APP_CANDY_MACHINE_ID=__PLACEHOLDER__ -REACT_APP_SOLANA_NETWORK=devnet -REACT_APP_SOLANA_RPC_HOST=https://api.devnet.solana.com - - -# ADDITIONAL PARAMS TO SET IF USING SPL-TOKEN AS MINTING CURRENCY ONLY : -# Spl-Token symbol to display next the price -REACT_APP_SPL_TOKEN_TO_MINT_NAME= - -# Spl-token decimals place defined on creation (default is 9) -REACT_APP_SPL_TOKEN_TO_MINT_DECIMALS= - -# To avoid harmless compilation warnings generating a build error, keep CI set to false -CI=false \ No newline at end of file diff --git a/src/Home.tsx b/src/Home.tsx index 9b53ebc..58116e0 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -86,6 +86,7 @@ export const MintPage = (props: HomeProps) => { const [endDate, setEndDate] = useState(); const [isPresale, setIsPresale] = useState(false); const [isWLOnly, setIsWLOnly] = useState(false); + const [refreshFlag, setRefreshFlag] = useState(false) const [alertState, setAlertState] = useState({ open: false, @@ -469,9 +470,19 @@ export const MintPage = (props: HomeProps) => { props.connection, isEnded, isPresale, - refreshCandyMachineState + refreshCandyMachineState, + refreshFlag ]); + useEffect( + () => { + let timer1 = setInterval(() => setRefreshFlag(!refreshFlag), 5000); + return () => { + clearInterval(timer1); + }; + }, + [refreshFlag] + ); const mobileMarker = isMobile()