package ui

import (
	loginpage "github.com/dece2183/yamusic-tui/ui/model/loginPage"
	mainpage "github.com/dece2183/yamusic-tui/ui/model/mainPage"

	"github.com/dece2183/yamusic-tui/config"
	"github.com/dece2183/yamusic-tui/ui/model"
)

func Run() {
	var err error

	if config.Current.Token == "" {
		err = loginpage.New().Run()
		if err != nil {
			model.PrettyExit(err, 4)
		}
	}

	err = mainpage.New().Run()
	if err != nil {
		model.PrettyExit(err, 6)
	}
}
