This commit is contained in:
Abhishek Sinha 2020-08-14 12:12:26 +05:30
commit 8ad6ef33d5

View File

@ -304,7 +304,7 @@
<div id="display_balance"> <div id="display_balance">
<h5>Rupee Balance</h5> <h5>Rupee Balance</h5>
<h3 id="token_balance">0</h3> <h3 id="token_balance">0</h3>
<svg class="icon" onclick="refresh_balance()" viewBox="0 0 64 64"> <svg class="icon" onclick="refresh_balance(this)" viewBox="0 0 64 64">
<title>refresh balance</title> <title>refresh balance</title>
<path d="M60.94,43.13A30.87,30.87,0,1,1,59,17.93" /> <path d="M60.94,43.13A30.87,30.87,0,1,1,59,17.93" />
<polyline points="63.09 0.1 59.3 18.87 40.49 15.08" /> <polyline points="63.09 0.1 59.3 18.87 40.49 15.08" />
@ -2121,6 +2121,7 @@ slot[name="tab"]::slotted(.active){
} }
slot::slotted(.active){ slot::slotted(.active){
border-radius: 2rem; border-radius: 2rem;
opacity: 1;
background-color: rgba(var(--text), .16); background-color: rgba(var(--text), .16);
} }
</style> </style>
@ -2187,6 +2188,8 @@ slot[name="tab"]::slotted(.active){
outline: none; outline: none;
border-radius: 2rem; border-radius: 2rem;
text-transform: capitalize; text-transform: capitalize;
border: solid 1px rgba(var(--text), .16);
opacity: 0.9;
} }
.sm-option:hover{ .sm-option:hover{
background: rgba(var(--text), 0.1); background: rgba(var(--text), 0.1);
@ -11961,8 +11964,12 @@ slot[name="tab"]::slotted(.active){
} }
} }
async function refresh_balance() { async function refresh_balance(refreshButton) {
try { try {
if(refreshButton){
notify('Updating Balance')
refreshButton.classList.add('animate-loader')
}
const current_token_balance = document.getElementById('token_balance').textContent; const current_token_balance = document.getElementById('token_balance').textContent;
if (typeof current_token_balance == "string") { if (typeof current_token_balance == "string") {
const get_user_balance = await ajaxGet('https://ranchimallflo.duckdns.org/api/v1.0/getFloAddressBalance?token=rupee&floAddress=' + myFloID) const get_user_balance = await ajaxGet('https://ranchimallflo.duckdns.org/api/v1.0/getFloAddressBalance?token=rupee&floAddress=' + myFloID)
@ -11973,6 +11980,10 @@ slot[name="tab"]::slotted(.active){
= get_user_balance.balance; = get_user_balance.balance;
} }
} }
if (refreshButton) {
notify('Balance Updated')
refreshButton.classList.remove('animate-loader')
}
return true; return true;
} catch (error) { } catch (error) {
throw new Error(error); throw new Error(error);