~edwargix/tallyard

5fe6587cd33eefeb78047867aa6e40ce48269499 — David Florness 4 years ago af3ac82
TUI: don't update app's queue in input capture

tview doesn't seem to like this
1 files changed, 4 insertions(+), 4 deletions(-)

M ui/tui.go
M ui/tui.go => ui/tui.go +4 -4
@@ 228,10 228,10 @@ func ElectionTUI(client *mautrix.Client, el *election.Election) {
		frame.AddText("Press enter to start the election", false, tview.AlignCenter, tcell.ColorWhite)
		app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
			if event.Key() == tcell.KeyEnter {
				app.QueueUpdateDraw(func() {
					frame.Clear()
					frame.AddText("Starting election...", false, tview.AlignCenter, tcell.ColorWhite)
				})
				// app.QueueUpdateDraw(func() {
				// 	frame.Clear()
				// 	frame.AddText("Starting election...", false, tview.AlignCenter, tcell.ColorWhite)
				// })
				err := el.StartElection(client)
				if err != nil {
					panic(err)