Merge branch 'cointop-sh:master' into feature/update-deps

pull/288/head
Simon Roberts 3 years ago committed by GitHub
commit 2db45d09ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,8 +1,6 @@
package cointop package cointop
import ( import (
"errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -106,12 +104,6 @@ func (ct *Cointop) UpdateCoin(coin *Coin) error {
return err return err
} }
k, found := ct.State.allCoinsSlugMap.Load(coin.Name)
if !found {
log.Debugf("UpdateCoin() could not found coin %s in the slug map", coin.Name)
return errors.New("could not find coin index in allCoinsSlugMap")
}
coin = &Coin{ coin = &Coin{
ID: v.ID, ID: v.ID,
Name: v.Name, Name: v.Name,
@ -131,7 +123,7 @@ func (ct *Cointop) UpdateCoin(coin *Coin) error {
Slug: v.Slug, Slug: v.Slug,
} }
ct.State.allCoinsSlugMap.Store(k, coin) ct.State.allCoinsSlugMap.Store(coin.Name, coin)
return nil return nil
} }

@ -235,6 +235,10 @@ func (ct *Cointop) SetCurrencyConverstion(convert string) error {
func (ct *Cointop) SetCurrencyConverstionFn(convert string) func() error { func (ct *Cointop) SetCurrencyConverstionFn(convert string) func() error {
log.Debug("SetCurrencyConverstionFn()") log.Debug("SetCurrencyConverstionFn()")
return func() error { return func() error {
if !ct.State.convertMenuVisible {
return nil
}
ct.HideConvertMenu() ct.HideConvertMenu()
if err := ct.SetCurrencyConverstion(convert); err != nil { if err := ct.SetCurrencyConverstion(convert); err != nil {

Loading…
Cancel
Save