refactor(ui): uncuddle return statement in NewApp()

This commit is contained in:
ayntgl 2022-02-09 21:44:07 +04:00
parent 4c67f93017
commit f4283093ad
2 changed files with 4 additions and 1 deletions

View file

@ -13,6 +13,7 @@ const keyringServiceName = "discordo"
func main() {
app := ui.NewApp()
app.EnableMouse(app.Config.General.Mouse)
token := os.Getenv("DISCORDO_TOKEN")
if token == "" {
@ -85,7 +86,8 @@ func main() {
app.SetRoot(loginForm, true)
}
if err := app.EnableMouse(app.Config.General.Mouse).Run(); err != nil {
err := app.Run()
if err != nil {
panic(err)
}
}

View file

@ -24,6 +24,7 @@ type App struct {
func NewApp() *App {
s, _ := discordgo.New()
return &App{
Application: tview.NewApplication(),
MainFlex: tview.NewFlex(),