Skip to content
Snippets Groups Projects
Commit c60f7420 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

finished handling button press error cases

parent 8ea8334a
No related branches found
No related tags found
No related merge requests found
......@@ -81,16 +81,17 @@ func btnClicked(sender *gowd.Element, event *gowd.EventElement) {
} else {
body.AddHTML(fmt.Sprintf("<textarea readonly style\"width:100%;\">{}</textarea>", string(payload)), nil)
}
sender.SetText("Start")
body.RemoveElement(text)
body.Enable()
}
err := singleMngr.TransmitSingleUse(botContact, []byte(message),
"xxCoinGame", 10, replyFunc, 30*time.Second)
// clean up - remove the added elements
defer func() {
if err!=nil{
body.AddHTML(fmt.Sprintf("<textarea readonly style\"width:100%;\">{}</textarea>", string(err.Error())), nil)
sender.SetText("Start")
body.RemoveElement(text)
body.Enable()
}()
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment