cointop-sh / cointop

A fast and lightweight interactive terminal based UI application for tracking cryptocurrencies 🚀
https://cointop.sh
Apache License 2.0
3.98k stars 311 forks source link

Cointop keeps overwriting my non-default column selection #244

Closed lyricnz closed 2 years ago

lyricnz commented 2 years ago

While working on a PR that involves adding some columns #243 , I've noticed that cointop frequently overwrites my configuration with the defaults. This may be related to #233.

Maybe it would be better if cointop never wrote the configuration file - per #238

lyricnz commented 2 years ago

I think I've figured out this bug. During config load, it calls SetupConfig => LoadPortfolioFromConfig => SetPortfolioEntry => ct.Save() Which saves the current (half-loaded) configuration back to the file

It's a bit random because the order the config elements are processed in is random (it's looping across a map).

https://github.com/cointop-sh/cointop/blob/master/cointop/config.go#L579

lyricnz commented 2 years ago

I fixed this in the portfolio-holdings PR that's coming up https://github.com/cointop-sh/cointop/pull/243/commits/ac3acbc6b1e50e122d2923405f69620c771f32dc