diff --git a/package-lock.json b/package-lock.json index 2c22b2ed..aaabdc9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "browser-extension", - "version": "1.1.4", + "version": "1.1.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "browser-extension", - "version": "1.1.4", + "version": "1.1.5", "dependencies": { "@mintlayer/entropy-generator": "^1.0.2", "@testing-library/jest-dom": "^6.1.4", diff --git a/package.json b/package.json index e5eaea4d..fa8fe0ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "browser-extension", - "version": "1.1.4", + "version": "1.1.5", "private": true, "dependencies": { "@mintlayer/entropy-generator": "^1.0.2", diff --git a/public/manifestDefault.json b/public/manifestDefault.json index cba521ba..332d529a 100644 --- a/public/manifestDefault.json +++ b/public/manifestDefault.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Mojito - A Mintlayer Wallet", - "version": "1.1.4", + "version": "1.1.5", "short_name": "Mojito", "description": "Mojito is a non-custodial decentralized crypto wallet that lets you send and receive BTC and ML from any other address.", "homepage_url": "https://www.mintlayer.org/", diff --git a/public/manifestFirefox.json b/public/manifestFirefox.json index 689eac3c..3c62a21f 100644 --- a/public/manifestFirefox.json +++ b/public/manifestFirefox.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Mojito - A Mintlayer Wallet", - "version": "1.1.4", + "version": "1.1.5", "short_name": "Mojito", "description": "Mojito is a non-custodial decentralized crypto wallet that lets you send and receive BTC and ML from any other address.", "homepage_url": "https://www.mintlayer.org/", diff --git a/src/components/containers/Login/SetPassword.js b/src/components/containers/Login/SetPassword.js index 8871fe0c..62c5a345 100644 --- a/src/components/containers/Login/SetPassword.js +++ b/src/components/containers/Login/SetPassword.js @@ -61,7 +61,7 @@ const SetPassword = ({ onChangePassword, onSubmit, checkPassword }) => {
-
+ {!unlockingAccount ? ( <> diff --git a/src/components/containers/SendTransaction/SendTransaction.js b/src/components/containers/SendTransaction/SendTransaction.js index ad5623bd..83512211 100644 --- a/src/components/containers/SendTransaction/SendTransaction.js +++ b/src/components/containers/SendTransaction/SendTransaction.js @@ -13,6 +13,7 @@ import AmountField from './AmountField' import FeesField from './FeesField' import './SendTransaction.css' +import { Error } from '@BasicComponents' const SendTransaction = ({ totalFeeFiat: totalFeeFiatParent, @@ -44,6 +45,7 @@ const SendTransaction = ({ const [passValidity, setPassValidity] = useState(false) const [passPristinity, setPassPristinity] = useState(true) const [passErrorMessage, setPassErrorMessage] = useState('') + const [txErrorMessage, setTxErrorMessage] = useState('') const [sendingTransaction, setSendingTransaction] = useState(false) const [transactionTxid, setTransactionTxid] = useState(false) const [allowClosing, setAllowClosing] = useState(true) @@ -62,6 +64,7 @@ const SendTransaction = ({ setPassValidity(false) setPass('') setPassErrorMessage('') + // setTxErrorMessage('') setOpenSendFundConfirmation(state) } @@ -90,14 +93,26 @@ const SendTransaction = ({ setTransactionTxid(txid) setPassValidity(true) setPassErrorMessage('') + setTxErrorMessage('') setAskPassword(false) } catch (e) { - console.error(e) - setPassPristinity(false) - setPassValidity(false) - setPass('') - setPassErrorMessage('Incorrect password. Account could not be unlocked') - setAllowClosing(true) + if (e.address === '') { + // password is not correct + setPassErrorMessage('Incorrect password') + setPassPristinity(false) + setPassValidity(false) + setPass('') + setAllowClosing(true) + } else { + // handle other errors + setAskPassword(false) + setPassPristinity(false) + setPassValidity(false) + setPass('') + setTxErrorMessage(e.message) + setAllowClosing(true) + setPopupState(false) + } } finally { setSendingTransaction(false) } @@ -230,12 +245,21 @@ const SendTransaction = ({ totalFeeInCrypto={totalFeeCrypto} /> + {/* TODO style error from transaction */} + {txErrorMessage ? ( + <> + + + ) : ( + <> + )} +