From c013635a1a4070ca7fd7559461164d7b6253a4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o?= Date: Sat, 7 Dec 2024 17:08:27 -0300 Subject: [PATCH 1/3] fix: value should be null, not undefined --- react/lib/components/Widget/AltpaymentWidget.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/lib/components/Widget/AltpaymentWidget.tsx b/react/lib/components/Widget/AltpaymentWidget.tsx index 7c7a1469..6d5a9507 100644 --- a/react/lib/components/Widget/AltpaymentWidget.tsx +++ b/react/lib/components/Widget/AltpaymentWidget.tsx @@ -414,7 +414,7 @@ export const AltpaymentWidget: React.FunctionComponent = props { handleNetworkChange(e); }} From 1db7698ed28a8096a3b4eb9db26234f9cc5c72c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o?= Date: Sat, 7 Dec 2024 17:10:04 -0300 Subject: [PATCH 2/3] fix: button rendering --- react/lib/components/Widget/AltpaymentWidget.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/react/lib/components/Widget/AltpaymentWidget.tsx b/react/lib/components/Widget/AltpaymentWidget.tsx index 6d5a9507..fe93cb49 100644 --- a/react/lib/components/Widget/AltpaymentWidget.tsx +++ b/react/lib/components/Widget/AltpaymentWidget.tsx @@ -186,7 +186,7 @@ export const AltpaymentWidget: React.FunctionComponent = props copiedMessage.style.padding = "5px 0 5px 5px"; copiedMessage.style.zIndex = "10"; copiedMessage.style.display = "none"; - + if (contentElement) { const content = contentElement.textContent || ""; navigator.clipboard.writeText(content); @@ -344,7 +344,7 @@ export const AltpaymentWidget: React.FunctionComponent = props
{altpaymentShift.id}
Copy copyToClipboard('sideshift_id')}/> - + ) ) : loadingShift ? (

Loading Shift...

@@ -370,6 +370,7 @@ export const AltpaymentWidget: React.FunctionComponent = props Send {pairAmount} {selectedCoin?.name} )} +
Date: Sat, 7 Dec 2024 18:19:53 -0300 Subject: [PATCH 3/3] fix: fixed amount should still show sideshift option --- react/lib/components/Widget/Widget.tsx | 2 +- react/lib/components/Widget/WidgetContainer.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/react/lib/components/Widget/Widget.tsx b/react/lib/components/Widget/Widget.tsx index 152888ad..b0fe8be5 100644 --- a/react/lib/components/Widget/Widget.tsx +++ b/react/lib/components/Widget/Widget.tsx @@ -368,7 +368,7 @@ export const Widget: React.FunctionComponent = props => { const usdAmount = usdPrice * +thisAmount setIsAboveMinimumAltpaymentUSDAmount(usdAmount >= MINIMUM_ALTPAYMENT_DOLLAR_AMOUNT) } - }, [to, thisAmount]); + }, [to, thisAmount, usdPrice]); useEffect(() => { const invalidAmount = diff --git a/react/lib/components/Widget/WidgetContainer.tsx b/react/lib/components/Widget/WidgetContainer.tsx index 084dcd4e..92e41a1e 100644 --- a/react/lib/components/Widget/WidgetContainer.tsx +++ b/react/lib/components/Widget/WidgetContainer.tsx @@ -155,7 +155,7 @@ export const WidgetContainer: React.FunctionComponent = } else { const expectedAmount = amount ? resolveNumber(amount) : undefined; const receivedAmount = resolveNumber(transaction.amount); - + if (await shouldTriggerOnSuccess( transaction, currency, @@ -173,7 +173,7 @@ export const WidgetContainer: React.FunctionComponent = if (sound) { txSound.play().catch(() => {}); } - + const currencyTicker = getCurrencyTypeFromAddress(to); if (!hideToasts) enqueueSnackbar( @@ -219,14 +219,14 @@ export const WidgetContainer: React.FunctionComponent = ); useEffect(() => { - if (price === undefined) { + if (price === undefined || price === 0) { (async () => { getPrice(); })() } else { setThisPrice(price) } - }, [currency, price]); + }, [currency, price, usdPrice]); const handleNewTransaction = useCallback( (tx: Transaction) => {