From 094866c1294de9fb2fcf80448f513283d9403af7 Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Wed, 9 Apr 2025 14:49:41 +0300 Subject: [PATCH] add a logdb field to lhs and setter function --- handlers/local.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/handlers/local.go b/handlers/local.go index 3116b66..64bc38f 100644 --- a/handlers/local.go +++ b/handlers/local.go @@ -27,6 +27,7 @@ type LocalHandlerService struct { DbRs *resource.DbResource Pe *persist.Persister UserdataStore *db.Db + LogDb *db.Db Cfg engine.Config Rs resource.Resource first resource.EntryFunc @@ -57,12 +58,16 @@ func (ls *LocalHandlerService) SetDataStore(db *db.Db) { ls.UserdataStore = db } +func (ls *LocalHandlerService) SetLogDb(db *db.Db) { + ls.LogDb = db +} + func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService) (*application.MenuHandlers, error) { replaceSeparatorFunc := func(input string) string { return strings.ReplaceAll(input, ":", ls.Cfg.MenuSeparator) } - appHandlers, err := application.NewMenuHandlers(ls.Parser, *ls.UserdataStore, accountService, replaceSeparatorFunc) + appHandlers, err := application.NewMenuHandlers(ls.Parser, *ls.UserdataStore, *ls.LogDb, accountService, replaceSeparatorFunc) if err != nil { return nil, err }