mirror of
https://github.com/miguelmota/cointop
synced 2024-11-05 00:00:14 +00:00
Save chart height after change.
This commit is contained in:
parent
a85fb5ea50
commit
95a31d5488
@ -342,6 +342,10 @@ func (ct *Cointop) ShortenChart() error {
|
||||
ct.State.chartHeight = candidate
|
||||
ct.State.lastChartHeight = ct.State.chartHeight
|
||||
|
||||
if err := ct.Save(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
go ct.UpdateChart()
|
||||
return nil
|
||||
}
|
||||
@ -356,6 +360,10 @@ func (ct *Cointop) EnlargeChart() error {
|
||||
ct.State.chartHeight = candidate
|
||||
ct.State.lastChartHeight = ct.State.chartHeight
|
||||
|
||||
if err := ct.Save(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
go ct.UpdateChart()
|
||||
return nil
|
||||
}
|
||||
|
@ -304,7 +304,6 @@ func (ct *Cointop) ConfigToToml() ([]byte, error) {
|
||||
chartMapIfc := map[string]interface{}{}
|
||||
chartMapIfc["max_width"] = ct.State.maxChartWidth
|
||||
chartMapIfc["height"] = ct.State.chartHeight
|
||||
log.Debugf("XXX chart = %s", chartMapIfc)
|
||||
|
||||
var inputs = &ConfigFileConfig{
|
||||
API: apiChoiceIfc,
|
||||
@ -359,6 +358,7 @@ func (ct *Cointop) loadChartConfig() error {
|
||||
chartHeightIfc, ok := ct.config.Chart["height"]
|
||||
if ok {
|
||||
ct.State.chartHeight = int(chartHeightIfc.(int64))
|
||||
ct.State.lastChartHeight = ct.State.chartHeight
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user