removed leftover commented code
This commit is contained in:
parent
ccd9e9cd77
commit
bad273fa58
@ -101,14 +101,12 @@ func NewMenuHandlers(appFlags *FlagManager, userdataStore db.Db, accountService
|
|||||||
return h, nil
|
return h, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithPersister sets persister instance to the handlers.
|
// SetPersister sets persister instance to the handlers.
|
||||||
// func (h *MenuHandlers) WithPersister(pe *persist.Persister) *MenuHandlers {
|
|
||||||
func (h *MenuHandlers) SetPersister(pe *persist.Persister) {
|
func (h *MenuHandlers) SetPersister(pe *persist.Persister) {
|
||||||
if h.pe != nil {
|
if h.pe != nil {
|
||||||
panic("persister already set")
|
panic("persister already set")
|
||||||
}
|
}
|
||||||
h.pe = pe
|
h.pe = pe
|
||||||
//return h
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init initializes the handler for a new session.
|
// Init initializes the handler for a new session.
|
||||||
|
@ -265,7 +265,6 @@ func TestWithPersister(t *testing.T) {
|
|||||||
h.SetPersister(p)
|
h.SetPersister(p)
|
||||||
|
|
||||||
assert.Equal(t, p, h.pe, "The persister should be set correctly.")
|
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) {
|
func TestWithPersister_PanicWhenAlreadySet(t *testing.T) {
|
||||||
|
@ -60,7 +60,6 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
//appHandlers = appHandlers.WithPersister(ls.Pe)
|
|
||||||
appHandlers.SetPersister(ls.Pe)
|
appHandlers.SetPersister(ls.Pe)
|
||||||
ls.DbRs.AddLocalFunc("set_account_flags", appHandlers.SetAccountFlags)
|
ls.DbRs.AddLocalFunc("set_account_flags", appHandlers.SetAccountFlags)
|
||||||
ls.DbRs.AddLocalFunc("set_language", appHandlers.SetLanguage)
|
ls.DbRs.AddLocalFunc("set_language", appHandlers.SetLanguage)
|
||||||
|
Loading…
Reference in New Issue
Block a user