Shorten status messages to 2 seconds

This commit is contained in:
Christian Rocha 2020-08-21 16:41:06 -04:00 committed by Christian Muehlhaeuser
parent d6f296c44b
commit e01dc95d7d
3 changed files with 6 additions and 3 deletions

View file

@ -269,7 +269,7 @@ func pagerUpdate(msg tea.Msg, m pagerModel) (pagerModel, tea.Cmd) {
if m.statusMessageTimer != nil {
m.statusMessageTimer.Stop()
}
m.statusMessageTimer = time.NewTimer(time.Second * 3)
m.statusMessageTimer = time.NewTimer(statusMessageTimeout)
cmds = append(cmds, waitForStatusMessageTimeout(pagerContext, m.statusMessageTimer))
case stashErrMsg:

View file

@ -311,7 +311,7 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
if m.statusMessageTimer != nil {
m.statusMessageTimer.Stop()
}
m.statusMessageTimer = time.NewTimer(time.Second * 3)
m.statusMessageTimer = time.NewTimer(statusMessageTimeout)
cmds = append(cmds, waitForStatusMessageTimeout(stashContext, m.statusMessageTimer))
case statusMessageTimeoutMsg:

View file

@ -17,7 +17,10 @@ import (
te "github.com/muesli/termenv"
)
const noteCharacterLimit = 256 // should match server
const (
noteCharacterLimit = 256 // should match server
statusMessageTimeout = time.Second * 2 // how long to show status messages like "stashed!"
)
var (
config Config