From 6ac2d38241ed9163fbc745ea4f67c53a14f12c24 Mon Sep 17 00:00:00 2001 From: lissavxo Date: Wed, 22 Jan 2025 19:45:55 -0300 Subject: [PATCH 1/3] fix: sideshift amount decimals --- react/lib/components/Widget/AltpaymentWidget.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/react/lib/components/Widget/AltpaymentWidget.tsx b/react/lib/components/Widget/AltpaymentWidget.tsx index 79e02639..3d5f8124 100644 --- a/react/lib/components/Widget/AltpaymentWidget.tsx +++ b/react/lib/components/Widget/AltpaymentWidget.tsx @@ -11,7 +11,8 @@ import { } from '@material-ui/core'; import { resolveNumber, - CryptoCurrency + CryptoCurrency, + DECIMALS } from '../../util'; import { Button, animation } from '../Button/Button'; import { Socket } from 'socket.io-client'; @@ -149,8 +150,11 @@ export const AltpaymentWidget: React.FunctionComponent = props setPairAmount(pairAmount) if (coinPair !== undefined) { - const xecAmount = +coinPair.rate * +pairAmount - updateAmount(xecAmount.toString()) + const settleCoinAmount = +coinPair.rate * +pairAmount + + if(Object.keys(DECIMALS).includes(coinPair.settleCoin)){ + updateAmount(settleCoinAmount.toFixed(DECIMALS[coinPair.settleCoin])) + } } }; @@ -437,7 +441,7 @@ export const AltpaymentWidget: React.FunctionComponent = props

{' '} 1 {selectedCoin?.name} ~={' '} - {resolveNumber(coinPair.rate).toFixed(2)} XEC{' '} + {resolveNumber(coinPair.rate).toFixed(DECIMALS[coinPair.settleCoin])} {coinPair.settleCoin}{' '}

{altpaymentEditable ? ( Date: Thu, 23 Jan 2025 17:45:10 -0300 Subject: [PATCH 2/3] feat: open mobile new tab --- react/lib/components/Widget/Widget.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/react/lib/components/Widget/Widget.tsx b/react/lib/components/Widget/Widget.tsx index dc57fd3f..8876c0ba 100644 --- a/react/lib/components/Widget/Widget.tsx +++ b/react/lib/components/Widget/Widget.tsx @@ -525,7 +525,8 @@ export const Widget: React.FunctionComponent = props => { window.location.href = url; const isMobile = window.matchMedia('(pointer:coarse)').matches; if (isMobile) { - window.location.href = `https://cashtab.com/#/send?bip21=${url}`; + const webUrl = `https://cashtab.com/#/send?bip21=${url}`; + window.open(webUrl, '_blank'); } else { window.location.href = url; } From 47efd9b5e10d665f38066c8c0d99039559b10654 Mon Sep 17 00:00:00 2001 From: David Klakurka Date: Sat, 25 Jan 2025 21:24:36 -0800 Subject: [PATCH 3/3] Partial fix for PWA not loading on mobile. --- react/lib/components/Widget/Widget.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/react/lib/components/Widget/Widget.tsx b/react/lib/components/Widget/Widget.tsx index 8876c0ba..59847d9f 100644 --- a/react/lib/components/Widget/Widget.tsx +++ b/react/lib/components/Widget/Widget.tsx @@ -522,7 +522,6 @@ export const Widget: React.FunctionComponent = props => { if (addressType === 'XEC') { const hasExtension = getCashtabProviderStatus(); if (!hasExtension) { - window.location.href = url; const isMobile = window.matchMedia('(pointer:coarse)').matches; if (isMobile) { const webUrl = `https://cashtab.com/#/send?bip21=${url}`;