refactor(ui): remove NewApp()

This commit is contained in:
rigormorrtiss 2021-08-19 17:54:15 +04:00
parent 097b96f841
commit 85c7754a18
2 changed files with 3 additions and 16 deletions

View file

@ -57,7 +57,9 @@ func main() {
}{}
}
app = ui.NewApp(onAppInputCapture)
app = tview.NewApplication().
EnableMouse(true).
SetInputCapture(onAppInputCapture)
guildsTreeView = ui.NewGuildsTreeView(onGuildsTreeViewSelected)
channelsTreeView = ui.NewChannelsTreeView(onChannelsTreeViewSelected)
messagesTextView = ui.NewMessagesTextView(app)

View file

@ -1,15 +0,0 @@
package ui
import (
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
// NewApp creates and returns a new application.
func NewApp(onAppInputCapture func(*tcell.EventKey) *tcell.EventKey) (app *tview.Application) {
app = tview.NewApplication().
EnableMouse(true).
SetInputCapture(onAppInputCapture)
return app
}