Allow specifying links for stock symbol & chart

This commit is contained in:
Svilen Markov
2024-05-12 04:13:38 +01:00
parent 818138340c
commit 0fbc8dcb41
6 changed files with 41 additions and 34 deletions

View File

@@ -9,11 +9,11 @@ import (
"github.com/glanceapp/glance/internal/feed"
)
// TODO: rename to Markets at some point
type Stocks struct {
widgetBase `yaml:",inline"`
Stocks feed.Stocks `yaml:"-"`
Sort string `yaml:"sort-by"`
Tickers []feed.StockRequest `yaml:"stocks"`
Stocks feed.Stocks `yaml:"stocks"`
Sort string `yaml:"sort-by"`
}
func (widget *Stocks) Initialize() error {
@@ -23,7 +23,7 @@ func (widget *Stocks) Initialize() error {
}
func (widget *Stocks) Update(ctx context.Context) {
stocks, err := feed.FetchStocksDataFromYahoo(widget.Tickers)
stocks, err := feed.FetchStocksDataFromYahoo(widget.Stocks)
if !widget.canContinueUpdateAfterHandlingErr(err) {
return