mirror of https://github.com/miguelmota/cointop
initial favorites
Former-commit-id: db3cf1d7f95f094a30fe0a0cb4d079c79308e7d6 [formerly db3cf1d7f95f094a30fe0a0cb4d079c79308e7d6 [formerly e8f25d5a964bf04b530c444388de9abbe15865d7 [formerly 073b95e8996d5178fa6ea0958e7d035f85322b4f]]] Former-commit-id: d15e7425cb473d850fbc133c06aeafba2a18dbf1 Former-commit-id: 4624158aa075ba4f6ab628cf044592545c1d7c1f [formerly cc1f25a7c9683482fb49c98ad4436ed046582575] Former-commit-id: 3e1b9170d806d3ecc3dc85ff5d18e1009e7984bcpull/15/head
parent
ac287c6ab9
commit
de3cd565f8
@ -0,0 +1,21 @@
|
||||
package cointop
|
||||
|
||||
func (ct *Cointop) toggleShowFavorites() error {
|
||||
for _, v := range ct.allcoinsmap {
|
||||
if ct.favorites[v.Symbol] {
|
||||
v.Favorite = true
|
||||
}
|
||||
}
|
||||
|
||||
ct.filterByFavorites = !ct.filterByFavorites
|
||||
ct.sort(ct.sortby, ct.sortdesc, ct.coins)
|
||||
//ct.updateCoins()
|
||||
/*
|
||||
ct.update(func() {
|
||||
ct.tableview.Clear()
|
||||
ct.updateTable()
|
||||
})
|
||||
ct.rowChanged()
|
||||
*/
|
||||
return nil
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package cointop
|
||||
|
||||
type coin struct {
|
||||
ID string
|
||||
Name string
|
||||
Symbol string
|
||||
Rank int
|
||||
PriceUSD float64
|
||||
PriceBTC float64
|
||||
USD24HVolume float64
|
||||
MarketCapUSD float64
|
||||
AvailableSupply float64
|
||||
TotalSupply float64
|
||||
PercentChange1H float64
|
||||
PercentChange24H float64
|
||||
PercentChange7D float64
|
||||
LastUpdated string
|
||||
Favorite bool
|
||||
}
|
Loading…
Reference in New Issue