浏览代码

refactor: relocate tview theme initialization to newApplication and remove unused import

ayn2op 5 月之前
父节点
当前提交
586b68315b
共有 2 个文件被更改,包括 1 次插入2 次删除
  1. 1 0
      cmd/application.go
  2. 0 2
      cmd/root.go

+ 1 - 0
cmd/application.go

@@ -24,6 +24,7 @@ type application struct {
 }
 
 func newApplication(cfg *config.Config) *application {
+	tview.Styles = tview.Theme{}
 	app := &application{
 		Application: tview.NewApplication(),
 		cfg:         cfg,

+ 0 - 2
cmd/root.go

@@ -10,7 +10,6 @@ import (
 	"github.com/ayn2op/discordo/internal/consts"
 	"github.com/ayn2op/discordo/internal/keyring"
 	"github.com/ayn2op/discordo/internal/logger"
-	"github.com/ayn2op/tview"
 	"github.com/diamondburned/arikawa/v3/utils/ws"
 	"github.com/diamondburned/ningen/v3"
 	"github.com/spf13/cobra"
@@ -63,7 +62,6 @@ var (
 				}
 			}
 
-			tview.Styles = tview.Theme{}
 			app = newApplication(cfg)
 			return app.run(token)
 		},