mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-06-01 06:07:00 +00:00
fixes
This commit is contained in:
parent
7b61a4a153
commit
5b7c4e5224
20
src/App.tsx
20
src/App.tsx
@ -679,6 +679,24 @@ function App() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const refetchUserInfo = () => {
|
||||||
|
window
|
||||||
|
.sendMessage('userInfo')
|
||||||
|
.then((response) => {
|
||||||
|
if (response && !response.error) {
|
||||||
|
setUserInfo(response);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Failed to get user info:', error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getBalanceAndUserInfoFunc = () => {
|
||||||
|
getBalanceFunc();
|
||||||
|
refetchUserInfo();
|
||||||
|
};
|
||||||
const getLtcBalanceFunc = () => {
|
const getLtcBalanceFunc = () => {
|
||||||
setLtcBalanceLoading(true);
|
setLtcBalanceLoading(true);
|
||||||
chrome?.runtime?.sendMessage({ action: "ltcBalance" }, (response) => {
|
chrome?.runtime?.sendMessage({ action: "ltcBalance" }, (response) => {
|
||||||
@ -1526,7 +1544,7 @@ function App() {
|
|||||||
{balance?.toFixed(2)} QORT
|
{balance?.toFixed(2)} QORT
|
||||||
</TextP>
|
</TextP>
|
||||||
<RefreshIcon
|
<RefreshIcon
|
||||||
onClick={getBalanceFunc}
|
onClick={getBalanceAndUserInfoFunc}
|
||||||
sx={{
|
sx={{
|
||||||
fontSize: "16px",
|
fontSize: "16px",
|
||||||
color: "white",
|
color: "white",
|
||||||
|
@ -984,7 +984,7 @@ export async function getNameInfo() {
|
|||||||
const response = await fetch(validApi + '/names/primary/' + address);
|
const response = await fetch(validApi + '/names/primary/' + address);
|
||||||
const nameData = await response.json();
|
const nameData = await response.json();
|
||||||
if (nameData?.name) {
|
if (nameData?.name) {
|
||||||
return nameData[0].name;
|
return nameData.name;
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user