Retain stocks order by default
This commit is contained in:
parent
58967ab758
commit
948c117f5b
2 changed files with 9 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
type Stocks struct {
|
||||
widgetBase `yaml:",inline"`
|
||||
Stocks feed.Stocks `yaml:"-"`
|
||||
Sort string `yaml:"sort-by"`
|
||||
Tickers []feed.StockRequest `yaml:"stocks"`
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +29,10 @@ func (widget *Stocks) Update(ctx context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
stocks.SortByAbsChange()
|
||||
if widget.Sort == "absolute-change" {
|
||||
stocks.SortByAbsChange()
|
||||
}
|
||||
|
||||
widget.Stocks = stocks
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue