From 73b501c8aa806019d1a7a31446511770332ce1b5 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Mon, 27 Jan 2025 12:42:48 +0300 Subject: [PATCH] removed left over 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 53ada39..40b91d9 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -102,14 +102,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 7321738..f9f654d 100644 --- a/handlers/application/menuhandler_test.go +++ b/handlers/application/menuhandler_test.go @@ -266,7 +266,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 77e3980..fcdfa76 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("check_blocked_status", appHandlers.CheckBlockedStatus) ls.DbRs.AddLocalFunc("set_language", appHandlers.SetLanguage)