Browse Source

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

ayntgl 4 năm trước cách đây
mục cha
commit
f4283093ad
2 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 3 1
      main.go
  2. 1 0
      ui/app.go

+ 3 - 1
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)
 	}
 }

+ 1 - 0
ui/app.go

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