You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cointop/cointop/quit.go

37 lines
568 B
Go

5 years ago
package cointop
import (
"os"
5 years ago
"github.com/jroimartin/gocui"
5 years ago
)
func (ct *Cointop) quit() error {
return gocui.ErrQuit
}
func (ct *Cointop) quitView() error {
5 years ago
if ct.State.portfolioVisible {
ct.State.portfolioVisible = false
5 years ago
return ct.updateTable()
}
5 years ago
if ct.State.filterByFavorites {
ct.State.filterByFavorites = false
5 years ago
return ct.updateTable()
}
5 years ago
if ct.activeViewName() == ct.Views.Table.Name {
5 years ago
return ct.quit()
}
return nil
}
// Exit safely exit application
func (ct *Cointop) Exit() {
if ct.g != nil {
ct.g.Close()
} else {
os.Exit(0)
}
}