~edwargix/tallyard

921c59f195735b0ab539013e4aa7700bf0c3f7df — David Florness 4 years ago 66a563e
Only show election screen if local voter *hasn't* voted
2 files changed, 2 insertions(+), 2 deletions(-)

M cmd/tallyard/main.go
M ui/tui.go
M cmd/tallyard/main.go => cmd/tallyard/main.go +1 -1
@@ 129,7 129,7 @@ func main() {
	}()

	el := ui.TUI(client, data.Elections)
	if el == nil {
	if el == nil || el.LocalVoter.Ballot == nil {
		// user likely hit C-c
		return
	}

M ui/tui.go => ui/tui.go +1 -1
@@ 111,7 111,7 @@ func RoomTUI(client *mautrix.Client, roomID id.RoomID, elections *election.Elect
			el = elections.GetI(i - 1)
			// don't need to lock because this goroutine controls LocalVoter
			if el.LocalVoter != nil {
				if el.LocalVoter.Ballot != nil {
				if el.LocalVoter.Ballot == nil {
					ElectionTUI(client, el)
				}
			} else if joinElectionConfirmation(el) {