Allow specifying links for stock symbol & chart
This commit is contained in:
parent
818138340c
commit
0fbc8dcb41
6 changed files with 41 additions and 34 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue