Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev-04-03-2025 #205

Merged
merged 2 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "browser-extension",
"version": "1.3.6",
"version": "1.3.7",
"private": true,
"dependencies": {
"@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3",
Expand Down
2 changes: 1 addition & 1 deletion public/manifestDefault.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Mojito - A Mintlayer Wallet",
"version": "1.3.6",
"version": "1.3.7",
"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/",
Expand Down
2 changes: 1 addition & 1 deletion public/manifestFirefox.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Mojito - A Mintlayer Wallet",
"version": "1.3.6",
"version": "1.3.7",
"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/",
"icons": {
Expand Down
14 changes: 14 additions & 0 deletions src/components/composed/Balance/Balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ const Balance = ({ balance, balanceLocked, exchangeRate, walletType }) => {
if (walletType.name === 'Bitcoin') {
return 'BTC'
}
if (
!tokenBalances ||
!tokenBalances[walletType.name] ||
!tokenBalances[walletType.name].token_info
) {
return 'TKN'
}
return tokenBalances[walletType.name].token_info.token_ticker.string
}

Expand All @@ -42,6 +49,13 @@ const Balance = ({ balance, balanceLocked, exchangeRate, walletType }) => {
if (walletType.name === 'Bitcoin') {
return <BtcLogo />
}
if (
!tokenBalances ||
!tokenBalances[walletType.name] ||
!tokenBalances[walletType.name].token_info
) {
return <TokenLogoRound text={'TKN'} />
}
return (
<TokenLogoRound
text={tokenBalances[
Expand Down
2 changes: 1 addition & 1 deletion src/components/composed/Navigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const Navigation = ({ customNavigation }) => {
Logout
</li>
)}
<span className="slider-version">v1.3.6</span>
<span className="slider-version">v1.3.7</span>
</ul>
</>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ const SendTransaction = ({
</CenteredLayout>
</>
)}

{/* TODO: remove popup */}
{openSendFundConfirmation && (
<PopUp
setOpen={setPopupState}
Expand Down
3 changes: 2 additions & 1 deletion src/contexts/MintlayerProvider/MintlayerProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ const MintlayerProvider = ({ value: propValue, children }) => {
setLockedBalance(0)
setTokenBalances({})
setUtxos([])
setMlDelegationList([])
// TODO: eneable this when after remove popup confirmation
// setMlDelegationList([])
setMlDelegationsBalance(0)
}

Expand Down
4 changes: 3 additions & 1 deletion src/hooks/UseWalletInfo/useMlWalletInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const useMlWalletInfo = (addresses, token) => {
const nativecoins = ['Mintlayer', 'Bitcoin']

if (token && !nativecoins.includes(token)) {
const tokenBalance = tokenBalances[token].balance || 0
const tokenBalance = tokenBalances[token]?.balance
? tokenBalances[token].balance
: 0

return {
transactions: transactions.filter((tx) => tx.token_id === token),
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CreateRestore/CreateRestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const CreateRestorePage = () => {
className="footnote-version"
data-testid="footnote-name"
>
v1.3.6
v1.3.7
</small>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/DelegationWithdraw/DelegationWithdraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const DelegationWithdrawPage = () => {
)

const delegationBalance = Format.BTCValue(
MLHelpers.getAmountInCoins(currentDelegationInfo.balance),
MLHelpers.getAmountInCoins(currentDelegationInfo?.balance || 0),
)

const maxValueToken = delegationBalance - totalFeeCrypto
Expand Down Expand Up @@ -103,7 +103,7 @@ const DelegationWithdrawPage = () => {
? mlPrivKeys.mlMainnetPrivateKey
: mlPrivKeys.mlTestnetPrivateKey

const walletPrivKeys = await ML.getWalletPrivKeysList(
const walletPrivKeys = ML.getWalletPrivKeysList(
privKey,
networkType,
changeAddressesLength,
Expand Down
15 changes: 14 additions & 1 deletion src/pages/SendTransaction/SendTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ const SendTransactionPage = () => {
if (walletType.name === 'Bitcoin') {
return 'BTC'
}
if (
!tokenBalances ||
!tokenBalances[walletType.name] ||
!tokenBalances[walletType.name].token_info
) {
return 'TKN'
}
return tokenBalances[walletType.name].token_info.token_ticker.string
}

Expand Down Expand Up @@ -238,7 +245,13 @@ const SendTransactionPage = () => {
return result
}

const goBackToWallet = () => navigate('/wallet/' + walletType.name)
const goBackToWallet = () => {
if (walletType.tokenId) {
navigate('/')
} else {
navigate('/wallet/' + walletType.name)
}
}

return (
<>
Expand Down
Loading