scrtlabs / EthereumBridgeFrontend

Frontend for the Ethereum<>Secret Network bridge
Other
9 stars 22 forks source link

Please update the UI anywhere there is a viewing key that the user has created #145

Open secretchaingirl opened 3 years ago

secretchaingirl commented 3 years ago

Is it possible to update the UI with the balance of a token after a viewing key has been created?

Currently the UI continues to display the 🔎 magnifying glass and "View Balance". I really think the UI should automatically update to show the balance instead of having the user always reloading the page.

This would be a great change to anywhere there's a viewing key required.

cankisagun commented 3 years ago

this is probably a refresh optimization cc @Cashmaney

bitterbalpiraat commented 3 years ago

this is probably a refresh optimization cc @Cashmaney

Swap rates are also not recalculated post transactions (fail nor success). After successful tx: on-screen rate doesn’t seem to change (while the transaction should’ve changed the swap rate). After failed tx: At busier times, another user might have swapped after your swap-rate calculation and before your Keplr tx. -> Result: slippage. Should recalculate, but instead, now you’re forced to wait until an invisible timer refreshes your swap rates.

EDIT: Refresh optimization could also be implemented by stopping to refresh when the browser tab is out of focus. Here's what I wrote about it last week: Personally I feel like there is no need to keep updating swap pairs when the swap page is not the active browser tab. But upon re-jumping back to the swap tab, I’d like the pair to recalculate and see the latest price, instead of waiting for the invisible timer to recalculate it.