From 419df0b7a206199e05ae1ff4ab7e353a65eb4304 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Sat, 25 Jan 2020 22:22:57 -0500 Subject: [PATCH] Check for error in subscription and update Tea dependency --- go.mod | 2 +- go.sum | 6 ++++-- input/input.go | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 65b68c4..a0e36f1 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/charmbracelet/teaparty go 1.13 -require github.com/charmbracelet/tea v0.0.0-20200118154546-df52853f9d94 // indirect +require github.com/charmbracelet/tea v0.0.0-20200126032228-29799c315162 diff --git a/go.sum b/go.sum index 0039d8e..6867ad7 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,6 @@ -github.com/charmbracelet/tea v0.0.0-20200118154546-df52853f9d94 h1:m2xhUqOw6OcefbPBR9Il0J0n0gB1663NoKU+vvkiLdU= -github.com/charmbracelet/tea v0.0.0-20200118154546-df52853f9d94/go.mod h1:lijy1lXOKNwMjBu/jTT/DvR8yE9PhtX2olGFsCz9/Vk= +github.com/charmbracelet/tea v0.0.0-20200126032228-29799c315162 h1:BderJi+l/5OV27L0wfE3yUA6rXaDldcKAHVUt8DfYVw= +github.com/charmbracelet/tea v0.0.0-20200126032228-29799c315162/go.mod h1:UsFFdg04MNbcYi1r2FBtdDEFY07bObaYDKHhE1xZUaQ= github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 h1:A7GG7zcGjl3jqAqGPmcNjd/D9hzL95SuoOQAaFNdLU0= github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= +golang.org/x/sys v0.0.0-20200120151820-655fe14d7479 h1:LhLiKguPgZL+Tglay4GhVtfF0kb8cvOJ0dHTCBO8YNI= +golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/input/input.go b/input/input.go index 0381915..17a4c00 100644 --- a/input/input.go +++ b/input/input.go @@ -90,7 +90,10 @@ func cursor(s string, blink bool) string { // Subscription func Blink(model tea.Model) tea.Msg { - m, _ := model.(Model) + m, ok := model.(Model) + if !ok { + return tea.NewErrMsg("could not assert given model to the model we expected; make sure you're passing as input model") + } time.Sleep(m.BlinkSpeed) return CursorBlinkMsg{} }