Save chart height after change.

pull/189/head
Simon Roberts 3 years ago
parent a85fb5ea50
commit 95a31d5488
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -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…
Cancel
Save