From 764438b248d87f5f30b246067c30356a617bf7d2 Mon Sep 17 00:00:00 2001 From: finned-palmer Date: Sat, 10 Jul 2021 14:17:52 -0500 Subject: [PATCH 1/2] Show wallet scan progress --- .../src/js/components/lib/balance.js | 25 ++++++++++++++++--- .../src/js/components/lib/walletModal.js | 24 ++++++++++-------- pkg/btc-wallet/src/js/components/root.js | 11 ++++---- pkg/btc-wallet/src/js/hooks/useSettings.js | 12 +++++++++ 4 files changed, 53 insertions(+), 19 deletions(-) diff --git a/pkg/btc-wallet/src/js/components/lib/balance.js b/pkg/btc-wallet/src/js/components/lib/balance.js index a963a3dac2..55a88adfac 100644 --- a/pkg/btc-wallet/src/js/components/lib/balance.js +++ b/pkg/btc-wallet/src/js/components/lib/balance.js @@ -16,10 +16,12 @@ const Balance = () => { setPsbt, setFee, setError, + scanProgress, } = useSettings(); const [sending, setSending] = useState(false); const [copiedButton, setCopiedButton] = useState(false); const [copiedString, setCopiedString] = useState(false); + const scanning = scanProgress?.main !== null || scanProgress?.change !== null; const copyAddress = (arg) => { navigator.clipboard.writeText(address); @@ -93,10 +95,25 @@ const Balance = () => { > {value} - {`${sats}${unconfirmedString} sats`} + {scanning ? ( + + + + Balance will be updated shortly: + + + + + {scanProgress.main}/24 addresses scanned + + + + ) : ( + {`${sats}${unconfirmedString} sats`} + )}