From bad273fa58f0ef399cb43e559b8c36edf97ba4e0 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Mon, 20 Jan 2025 10:56:12 +0300 Subject: [PATCH] removed leftover commented code --- handlers/application/menuhandler.go | 4 +--- handlers/application/menuhandler_test.go | 1 - handlers/local.go | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index 48d134e..1661581 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -101,14 +101,12 @@ func NewMenuHandlers(appFlags *FlagManager, userdataStore db.Db, accountService return h, nil } -// WithPersister sets persister instance to the handlers. -// func (h *MenuHandlers) WithPersister(pe *persist.Persister) *MenuHandlers { +// SetPersister sets persister instance to the handlers. func (h *MenuHandlers) SetPersister(pe *persist.Persister) { if h.pe != nil { panic("persister already set") } h.pe = pe - //return h } // Init initializes the handler for a new session. diff --git a/handlers/application/menuhandler_test.go b/handlers/application/menuhandler_test.go index 4c0fa7f..f58e433 100644 --- a/handlers/application/menuhandler_test.go +++ b/handlers/application/menuhandler_test.go @@ -265,7 +265,6 @@ func TestWithPersister(t *testing.T) { h.SetPersister(p) assert.Equal(t, p, h.pe, "The persister should be set correctly.") - //assert.Equal(t, h, result, "The returned handler should be the same instance.") } func TestWithPersister_PanicWhenAlreadySet(t *testing.T) { diff --git a/handlers/local.go b/handlers/local.go index a3881c2..1227a18 100644 --- a/handlers/local.go +++ b/handlers/local.go @@ -60,7 +60,6 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService) if err != nil { return nil, err } - //appHandlers = appHandlers.WithPersister(ls.Pe) appHandlers.SetPersister(ls.Pe) ls.DbRs.AddLocalFunc("set_account_flags", appHandlers.SetAccountFlags) ls.DbRs.AddLocalFunc("set_language", appHandlers.SetLanguage)