mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-02-15 11:45:50 +00:00
added fixes
This commit is contained in:
parent
6de89494ac
commit
ac41fb7cc1
40
src/App.tsx
40
src/App.tsx
@ -103,6 +103,7 @@ function App() {
|
|||||||
}
|
}
|
||||||
}, [extState])
|
}, [extState])
|
||||||
|
|
||||||
|
|
||||||
const address = useMemo(() => {
|
const address = useMemo(() => {
|
||||||
if (!rawWallet?.address0) return "";
|
if (!rawWallet?.address0) return "";
|
||||||
return rawWallet.address0;
|
return rawWallet.address0;
|
||||||
@ -212,7 +213,7 @@ function App() {
|
|||||||
const getBalanceFunc = () => {
|
const getBalanceFunc = () => {
|
||||||
setQortBalanceLoading(true)
|
setQortBalanceLoading(true)
|
||||||
chrome.runtime.sendMessage({ action: "balance" }, (response) => {
|
chrome.runtime.sendMessage({ action: "balance" }, (response) => {
|
||||||
if (response && !response?.error) {
|
if (!response?.error && !isNaN(+response)) {
|
||||||
setBalance(response);
|
setBalance(response);
|
||||||
}
|
}
|
||||||
setQortBalanceLoading(false)
|
setQortBalanceLoading(false)
|
||||||
@ -221,7 +222,7 @@ function App() {
|
|||||||
const getLtcBalanceFunc = () => {
|
const getLtcBalanceFunc = () => {
|
||||||
setLtcBalanceLoading(true)
|
setLtcBalanceLoading(true)
|
||||||
chrome.runtime.sendMessage({ action: "ltcBalance" }, (response) => {
|
chrome.runtime.sendMessage({ action: "ltcBalance" }, (response) => {
|
||||||
if (response && !response?.error) {
|
if (!response?.error && !isNaN(+response)) {
|
||||||
setLtcBalance(response);
|
setLtcBalance(response);
|
||||||
}
|
}
|
||||||
setLtcBalanceLoading(false)
|
setLtcBalanceLoading(false)
|
||||||
@ -577,6 +578,7 @@ function App() {
|
|||||||
|
|
||||||
const resetAllStates = () => {
|
const resetAllStates = () => {
|
||||||
setExtstate("not-authenticated");
|
setExtstate("not-authenticated");
|
||||||
|
setAuthenticatedMode('qort')
|
||||||
setBackupjson(null);
|
setBackupjson(null);
|
||||||
setRawWallet(null);
|
setRawWallet(null);
|
||||||
setdecryptedWallet(null);
|
setdecryptedWallet(null);
|
||||||
@ -625,6 +627,11 @@ function App() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
getBalanceFunc();
|
getBalanceFunc();
|
||||||
|
chrome.runtime.sendMessage({ action: "getWalletInfo" }, (response) => {
|
||||||
|
if (response && response?.walletInfo) {
|
||||||
|
setRawWallet(response?.walletInfo);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (response?.error) {
|
} else if (response?.error) {
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
setWalletToBeDecryptedError(response.error)
|
setWalletToBeDecryptedError(response.error)
|
||||||
@ -724,7 +731,7 @@ function App() {
|
|||||||
</CopyToClipboard>
|
</CopyToClipboard>
|
||||||
<Spacer height="10px" />
|
<Spacer height="10px" />
|
||||||
{ltcBalanceLoading && <CircularProgress color="success" size={16} />}
|
{ltcBalanceLoading && <CircularProgress color="success" size={16} />}
|
||||||
{ltcBalance && !isNaN(+ltcBalance) && !ltcBalanceLoading && (
|
{!isNaN(+ltcBalance) && !ltcBalanceLoading && (
|
||||||
<Box sx={{
|
<Box sx={{
|
||||||
gap: '10px',
|
gap: '10px',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
@ -772,19 +779,18 @@ function App() {
|
|||||||
</CopyToClipboard>
|
</CopyToClipboard>
|
||||||
<Spacer height="10px" />
|
<Spacer height="10px" />
|
||||||
{qortBalanceLoading && <CircularProgress color="success" size={16} />}
|
{qortBalanceLoading && <CircularProgress color="success" size={16} />}
|
||||||
{balance && (
|
{(balance >= 0) && (
|
||||||
<TextP
|
<TextP
|
||||||
sx={{
|
sx={{
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
lineHeight: "24px",
|
lineHeight: "24px",
|
||||||
fontSize: "20px",
|
fontSize: "20px",
|
||||||
fontWeight: 700,
|
fontWeight: 700,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{balance} QORT
|
{balance?.toFixed(2)} QORT
|
||||||
</TextP>
|
</TextP>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Spacer height="55px" />
|
<Spacer height="55px" />
|
||||||
<CustomButton
|
<CustomButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@ -896,7 +902,7 @@ function App() {
|
|||||||
fontWeight: 700,
|
fontWeight: 700,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{balance} QORT
|
{balance?.toFixed(2)} QORT
|
||||||
</TextP>
|
</TextP>
|
||||||
</Box>
|
</Box>
|
||||||
<Spacer height="35px" />
|
<Spacer height="35px" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user