mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Constantize the defaultFocus value for each module
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultFocusable = false
|
||||
defaultTitle = "HIBP"
|
||||
minRefreshInterval = 21600 // Six hours
|
||||
)
|
||||
@@ -32,7 +33,7 @@ type Settings struct {
|
||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
settings := &Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||
|
||||
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_HIBP_TOKEN"))),
|
||||
accounts: utils.ToStrs(ymlConfig.UList("accounts")),
|
||||
|
||||
@@ -19,7 +19,7 @@ type Widget struct {
|
||||
// NewWidget creates a new instance of a widget
|
||||
func NewWidget(app *tview.Application, settings *Settings) *Widget {
|
||||
widget := &Widget{
|
||||
TextWidget: view.NewTextWidget(app, settings.common, false),
|
||||
TextWidget: view.NewTextWidget(app, settings.common),
|
||||
|
||||
settings: settings,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user