Skip to content

Commit

Permalink
Merge pull request #131 from QuickSwap/hotfix/fix-audit
Browse files Browse the repository at this point in the history
Fix audit issues
  • Loading branch information
FriskyHamTitz authored Apr 21, 2022
2 parents 30c99c9 + 06b1d81 commit 2949de1
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 409 deletions.
21 changes: 18 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,28 @@
"workbox-routing": "^6.1.0"
},
"resolutions": {
"@walletconnect/web3-provider": "1.1.1-alpha.0"
"yargs-parser": "^13.1.2",
"underscore": "^1.12.1",
"lodash": "^4.17.21",
"trim-newlines": "^3.0.1",
"nth-check": "^2.0.1",
"node-fetch": "^2.6.7",
"follow-redirects": "^1.14.8",
"axios": "^0.21.2",
"immer": "^9.0.6",
"ansi-html": "^0.0.8",
"node-forge": "^1.3.0",
"glob-parent": "^5.1.2",
"browserslist": "^4.16.5",
"ajv": "^6.12.3",
"async": "^3.2.2",
"moment": "^2.29.2"
},
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"start": "react-app-rewired start",
"build": "CI=false react-app-rewired --max_old_space_size=4096 build",
"test": "react-scripts test --env=jsdom",
"test": "react-app-rewired test --env=jsdom",
"format": "prettier --write \"**/*.{ts,js,tsx,json,md}\"",
"eject": "react-scripts eject",
"integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run'",
Expand Down Expand Up @@ -129,7 +144,7 @@
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.60",
"apexcharts": "3.32.1",
"moment": "^2.29.1",
"moment": "^2.29.2",
"react-apexcharts": "1.3.9",
"react-cool-inview": "^2.0.8",
"react-error-overlay": "^6.0.10",
Expand Down
21 changes: 19 additions & 2 deletions src/components/WalletModal/WalletModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ const WalletModal: React.FC<WalletModalProps> = ({
}) => {
const classes = useStyles();
// important that these are destructed from the account-specific web3-react context
const { active, account, connector, activate, error } = useWeb3React();
const {
active,
account,
connector,
activate,
error,
deactivate,
} = useWeb3React();

const [walletView, setWalletView] = useState(WALLET_VIEWS.ACCOUNT);

Expand All @@ -85,7 +92,17 @@ const WalletModal: React.FC<WalletModalProps> = ({
if (account && !previousAccount && walletModalOpen) {
toggleWalletModal();
}
}, [account, previousAccount, toggleWalletModal, walletModalOpen]);
if (!walletModalOpen && error) {
deactivate();
}
}, [
account,
previousAccount,
toggleWalletModal,
walletModalOpen,
deactivate,
error,
]);

// always reset to account view
useEffect(() => {
Expand Down
Loading

0 comments on commit 2949de1

Please sign in to comment.