diff --git a/.env.dev b/.env.dev index 1f78123f..f2691738 100644 --- a/.env.dev +++ b/.env.dev @@ -9,7 +9,7 @@ REACT_APP_SUPPORT_URL="https://t.me/ceretroubleshooting" ## These are only required if using Sentry for error logging REACT_APP_SENTRY_DSN_URL="https://3d39fa05d843482eb93377947b435b5b@o318183.ingest.sentry.io/5987177" SENTRY_AUTH_TOKEN="db67ae12222811ecabd2564b6436d30d" -REACT_APP_SENTRY_RELEASE="0.20.0" +REACT_APP_SENTRY_RELEASE="0.21.0" REACT_APP_MAINTENANCE=false REACT_APP_CONNECT_WITH_SUBSTRATE_WALLET_ENABLED=true diff --git a/.env.prod b/.env.prod index 05e4eb35..5b48f5dc 100644 --- a/.env.prod +++ b/.env.prod @@ -9,7 +9,7 @@ REACT_APP_SUPPORT_URL="https://t.me/ceretroubleshooting" ## These are only required if using Sentry for error logging REACT_APP_SENTRY_DSN_URL="https://3d39fa05d843482eb93377947b435b5b@o318183.ingest.sentry.io/5987177" SENTRY_AUTH_TOKEN="db67ae12222811ecabd2564b6436d30d" -REACT_APP_SENTRY_RELEASE="0.20.0" +REACT_APP_SENTRY_RELEASE="0.21.0" REACT_APP_MAINTENANCE=false REACT_APP_CONNECT_WITH_SUBSTRATE_WALLET_ENABLED=true diff --git a/.env.stage b/.env.stage index 2816ddec..4667d3ff 100644 --- a/.env.stage +++ b/.env.stage @@ -9,7 +9,7 @@ REACT_APP_SUPPORT_URL="https://t.me/ceretroubleshooting" ## These are only required if using Sentry for error logging REACT_APP_SENTRY_DSN_URL="https://3d39fa05d843482eb93377947b435b5b@o318183.ingest.sentry.io/5987177" SENTRY_AUTH_TOKEN="db67ae12222811ecabd2564b6436d30d" -REACT_APP_SENTRY_RELEASE="0.20.0" +REACT_APP_SENTRY_RELEASE="0.21.0" REACT_APP_MAINTENANCE=false REACT_APP_CONNECT_WITH_SUBSTRATE_WALLET_ENABLED=true diff --git a/CHANGELOG.md b/CHANGELOG.md index cde60a0e..f46fc197 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ ## vNext ... +## v0.21.0 +- Fixed preflight check misaligned issue +- Fixed WalletConnect login issue after auth popup was closed +- Fixed app transfer page reset after mobile restart +- Fixed transfer page reset after provider disconnection +- Fixed Cere stuck connection after transfer from Polygon to Cere + ## v0.20.0 - Added support of the Cere node v2.32.0 @@ -10,7 +17,7 @@ ## v0.19.0 - WalletConnect integration -- Fix fallback mechanism launch after transaction was finished +- Fixed fallback mechanism launch after transaction was finished ## v0.18.0 @@ -27,7 +34,7 @@ ## v0.16.0 -- Rename ERC20 to ERC-20 +- Renamed ERC20 to ERC-20 - Migrated to GitHub actions ## v0.15.0 diff --git a/package.json b/package.json index 1c465c90..b00d1299 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@Cerebellum-Network/chainbridge-ui", - "version": "0.20.0", + "version": "0.21.0", "private": true, "dependencies": { "@celo-tools/celo-ethers-wrapper": "0.0.5", diff --git a/src/Components/Pages/TransferPage.tsx b/src/Components/Pages/TransferPage.tsx index cd4300d7..c7e15a6a 100644 --- a/src/Components/Pages/TransferPage.tsx +++ b/src/Components/Pages/TransferPage.tsx @@ -58,6 +58,7 @@ const useStyles = makeStyles(({ constants, palette }: ITheme) => position: "relative", backgroundColor: "white", minWidth: 400, + maxWidth: 430, "@media only screen and (max-width: 360px)": { minWidth: 320, }, @@ -114,7 +115,7 @@ const useStyles = makeStyles(({ constants, palette }: ITheme) => marginTop: constants.generalUnit * 3, }, title: { - fontSize: 24, + fontSize: 23, fontWeight: "bold", color: "black", textAlign: "center", @@ -528,12 +529,14 @@ const TransferPage = () => { .required("Please add a receiving address"), }); + const initialising = !isReady && !transactionStatus; + return (
{process.env.REACT_APP_MAINTENANCE === "false" && - (!isReady ? ( + (initialising ? ( <>
@@ -550,12 +553,12 @@ const TransferPage = () => { ))}
- {!isReady && process.env.REACT_APP_MAINTENANCE === "false" ? ( + {initialising && process.env.REACT_APP_MAINTENANCE === "false" ? (
) : ( <> )} - {!isReady ? ( + {initialising ? (
diff --git a/src/Contexts/Adaptors/EVMAdaptors/EVMHomeAdaptorProvider.tsx b/src/Contexts/Adaptors/EVMAdaptors/EVMHomeAdaptorProvider.tsx index 549d26b6..972bd8ac 100644 --- a/src/Contexts/Adaptors/EVMAdaptors/EVMHomeAdaptorProvider.tsx +++ b/src/Contexts/Adaptors/EVMAdaptors/EVMHomeAdaptorProvider.tsx @@ -142,7 +142,7 @@ export const EVMHomeAdaptorProvider = ({ useEffect(() => { if (initialising || homeBridge || !onboard) return; - console.log("starting init"); + console.log("Starting init"); setInitialising(true); wallet?.provider?.on("error", (err: any) => { @@ -151,7 +151,7 @@ export const EVMHomeAdaptorProvider = ({ // On the first connect to a blockchain this event doesn't happen wallet?.provider?.on("chainChanged", (newNetworkId: number) => { - console.log('chainChanged: ', { networkId, newNetworkId }); + console.log("Chain changed:", { networkId, newNetworkId }); if (newNetworkId === networkId) return; setNetworkId( newNetworkId.toString().substring(0, 2) === '0x' @@ -162,9 +162,10 @@ export const EVMHomeAdaptorProvider = ({ }); wallet?.provider?.on("accountsChanged", (accounts: string[])=> { - console.log('accountsChanged: ', { account, accounts }); - if (walletSelected) setWalletType("unset"); - setAccount(accounts[0]) + console.log("Accounts changed:", { walletSelected, account, accounts }); + const walletChanged = walletSelected && account && account !== accounts[0]; + if (walletChanged) setWalletType("unset"); + setAccount(accounts[0].toLowerCase()) }); const selectedWallet = localStorage.getItem(ONBOARD_SELECTED_WALLET) as string; @@ -174,11 +175,11 @@ export const EVMHomeAdaptorProvider = ({ onboard .walletSelect(selectedWallet) .then(async (success) => { - console.log('walletSelect:', { success }); + console.log("Wallet select:", { success }); setWalletSelected(success); if (success) { connected = await checkWallet() as boolean; - console.log('walletCheck:', { connected }); + console.log("Wallet check:", { connected }); } }) .catch((error) => { @@ -187,7 +188,11 @@ export const EVMHomeAdaptorProvider = ({ connected = false; }) .finally(() => { - if (!connected) setWalletType("unset"); + if (!connected) { + resetOnboard(); + setWalletType("unset"); + } + console.log("Wallet connection finished:", { connected }); }) } }, [ diff --git a/src/Contexts/ChainbridgeContext.tsx b/src/Contexts/ChainbridgeContext.tsx index c89098cc..d20c84cb 100644 --- a/src/Contexts/ChainbridgeContext.tsx +++ b/src/Contexts/ChainbridgeContext.tsx @@ -87,6 +87,7 @@ const ChainbridgeProvider = ({ setTransferTxHash, setHomeTransferTxHash, setAddress, + setWalletType } = useNetworkManager(); const { @@ -110,7 +111,6 @@ const ChainbridgeProvider = ({ } = useHomeBridge(); const resetDeposit = () => { - chainbridgeConfig.chains.length > 2 && setDestinationChain(undefined); setTransactionStatus(undefined); setDepositNonce(undefined); setDepositVotes(0); @@ -122,6 +122,7 @@ const ChainbridgeProvider = ({ setAddress(undefined); setTransferTxHash(undefined); setHomeTransferTxHash(undefined); + if (!isReady) setWalletType('unset'); }; const handleDeposit = useCallback(