From f4283093adf82b46d1446569647e804efea932fe Mon Sep 17 00:00:00 2001 From: ayntgl Date: Wed, 9 Feb 2022 21:44:07 +0400 Subject: [PATCH] refactor(ui): uncuddle return statement in NewApp() --- main.go | 4 +++- ui/app.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index fbe58d4..840ee98 100644 --- a/main.go +++ b/main.go @@ -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) } } diff --git a/ui/app.go b/ui/app.go index d7037e8..54399c9 100644 --- a/ui/app.go +++ b/ui/app.go @@ -24,6 +24,7 @@ type App struct { func NewApp() *App { s, _ := discordgo.New() + return &App{ Application: tview.NewApplication(), MainFlex: tview.NewFlex(),