From 14fa4cca819e246643f9d28d8f45d96872a5612c Mon Sep 17 00:00:00 2001 From: rigormorrtiss Date: Tue, 27 Jul 2021 23:45:33 +0400 Subject: [PATCH] Rename ui.NewApplication() to ui.NewApp() --- discordo.go | 4 ++-- ui/app.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/discordo.go b/discordo.go index 54d157b..d578fd7 100644 --- a/discordo.go +++ b/discordo.go @@ -32,7 +32,7 @@ func main() { channelsList = ui.NewChannelsList(onChannelsListSelected) messagesTextView = ui.NewMessagesTextView(onMessagesTextViewChanged) mainFlex = ui.NewMainFlex(guildsDropDown, channelsList, messagesTextView) - app = ui.NewApplication() + app = ui.NewApp() token := util.GetPassword("token") if token != "" { @@ -45,7 +45,7 @@ func main() { app.SetRoot(loginModal, true) } - if err := app.EnableMouse(true).Run(); err != nil { + if err := app.Run(); err != nil { panic(err) } } diff --git a/ui/app.go b/ui/app.go index 5ae112a..8218a13 100644 --- a/ui/app.go +++ b/ui/app.go @@ -4,8 +4,9 @@ import ( "github.com/rivo/tview" ) -func NewApplication() (app *tview.Application) { - app = tview.NewApplication() +func NewApp() (app *tview.Application) { + app = tview.NewApplication(). + EnableMouse(true) return }