This commit is contained in:
PhilReact 2025-05-28 18:55:03 +03:00
parent 44a2675c87
commit cfa4afc506
2 changed files with 20 additions and 2 deletions

View File

@ -855,6 +855,24 @@ function App() {
}); });
balanceSetInterval() balanceSetInterval()
}; };
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);
window window
@ -1639,7 +1657,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",

View File

@ -798,7 +798,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 '';
} }