Check for error in subscription and update Tea dependency

This commit is contained in:
Christian Rocha 2020-01-25 22:22:57 -05:00
parent c83a0bee59
commit 419df0b7a2
No known key found for this signature in database
GPG Key ID: D6CC7A16E5878018
3 changed files with 9 additions and 4 deletions

2
go.mod
View File

@ -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

6
go.sum
View File

@ -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=

View File

@ -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{}
}