Created
September 17, 2019 15:28
-
-
Save beber89/6dd9fdce39505168741c0f244f0619c8 to your computer and use it in GitHub Desktop.
renderer.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// renderPage reloads elements of the page when change to wallet occurs | |
func RenderPage() { | |
wlt := *GetWallet() | |
document := js.Global().Get("document") | |
chainView := (*wlt.GetBlockchain()).Draw() | |
if chn := document.Call("getElementById", "chain"); chn != js.Null() { | |
document.Call("getElementById", "blockchain-placeholder").Call("removeChild", chn) | |
} | |
document.Call("getElementById", "blockchain-placeholder").Call("appendChild", chainView) | |
networthLabel := document.Call("getElementById", "networth") | |
networthLabel.Set("innerHTML", wlt.Networth()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment