diff --git a/cointop/config.go b/cointop/config.go index 4e8db2e..2cbbd13 100644 --- a/cointop/config.go +++ b/cointop/config.go @@ -3,6 +3,7 @@ package cointop import ( "bytes" "fmt" + "io/ioutil" "os" "os/user" "strings" @@ -98,13 +99,12 @@ func (ct *Cointop) saveConfig() error { defer ct.savemux.Unlock() path := ct.configPath() if _, err := os.Stat(path); err == nil { - fo, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, 0666) - defer fo.Close() b, err := ct.configToToml() if err != nil { return err } - if _, err := fo.Write(b); err != nil { + err = ioutil.WriteFile(path, b, 0644) + if err != nil { return err } } diff --git a/cointop/layout.go b/cointop/layout.go index 8e2bb44..971e902 100644 --- a/cointop/layout.go +++ b/cointop/layout.go @@ -85,7 +85,6 @@ func (ct *Cointop) layout(g *gocui.Gui) error { ct.setActiveView("table") ct.intervalFetchData() } - ct.rowChanged() return nil } diff --git a/cointop/save.go b/cointop/save.go index 3967656..158441e 100644 --- a/cointop/save.go +++ b/cointop/save.go @@ -8,7 +8,7 @@ func (ct *Cointop) save() error { func (ct *Cointop) setSavingStatus() { go func() { - ct.loadingTicks("saving", 900) + ct.loadingTicks("saving", 590) ct.updateStatusbar("") ct.rowChanged() }() diff --git a/cointop/table.go b/cointop/table.go index 6739a2b..ad13719 100644 --- a/cointop/table.go +++ b/cointop/table.go @@ -88,6 +88,7 @@ func (ct *Cointop) refreshTable() error { ct.update(func() { ct.tableview.Clear() ct.table.Format().Fprint(ct.tableview) + ct.rowChanged() }) return nil @@ -142,7 +143,6 @@ func (ct *Cointop) updateTable() error { ct.coins = sliced ct.sort(ct.sortby, ct.sortdesc, ct.coins) ct.refreshTable() - ct.rowChanged() return nil }