Only do the dark background check once

This commit is contained in:
Toby Padilla 2020-05-16 13:45:32 -05:00 committed by Christian Muehlhaeuser
commit f00e5ccdba

View file

@ -93,6 +93,15 @@ func initialize(style string) func() (boba.Model, boba.Cmd) {
w, h, err := terminal.GetSize(int(os.Stdout.Fd()))
if style == "auto" {
dbg := te.HasDarkBackground()
if dbg == true {
style = "dark"
} else {
style = "light"
}
}
return model{
style: style,
spinner: s,