Просмотр исходного кода

refactor(login): remove unused param

ayn2op 10 месяцев назад
Родитель
Сommit
20fb3255f1
2 измененных файлов с 2 добавлено и 4 удалено
  1. 1 1
      cmd/application.go
  2. 1 3
      internal/login/form.go

+ 1 - 1
cmd/application.go

@@ -45,7 +45,7 @@ func newApplication(cfg *config.Config) *application {
 
 
 func (a *application) show(token string) error {
 func (a *application) show(token string) error {
 	if token == "" {
 	if token == "" {
-		loginForm := login.NewForm(a.cfg, a.Application, func(token string) {
+		loginForm := login.NewForm(a.cfg, func(token string) {
 			if err := a.show(token); err != nil {
 			if err := a.show(token); err != nil {
 				slog.Error("failed to show app", "err", err)
 				slog.Error("failed to show app", "err", err)
 				return
 				return

+ 1 - 3
internal/login/form.go

@@ -17,16 +17,14 @@ type DoneFn = func(token string)
 type Form struct {
 type Form struct {
 	*tview.Pages
 	*tview.Pages
 	cfg  *config.Config
 	cfg  *config.Config
-	app  *tview.Application
 	form *tview.Form
 	form *tview.Form
 	done DoneFn
 	done DoneFn
 }
 }
 
 
-func NewForm(cfg *config.Config, app *tview.Application, done DoneFn) *Form {
+func NewForm(cfg *config.Config, done DoneFn) *Form {
 	f := &Form{
 	f := &Form{
 		Pages: tview.NewPages(),
 		Pages: tview.NewPages(),
 		cfg:   cfg,
 		cfg:   cfg,
-		app:   app,
 		form:  tview.NewForm(),
 		form:  tview.NewForm(),
 		done:  done,
 		done:  done,
 	}
 	}