Added activeSym logs
Some checks failed
release / docker (push) Has been cancelled

This commit is contained in:
Alfred Kamanda 2025-03-20 14:35:06 +03:00
parent e564f1328b
commit 5f37856927
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -1941,9 +1941,11 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
flag_no_active_voucher, _ := h.flagManager.GetFlag("flag_no_active_voucher")
// check if the user has an active sym
_, err = userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM)
activeSym, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM)
if err != nil {
logg.InfoCtxf(ctx, "Checking the data as no", "DATA_ACTIVE_SYM", storedb.DATA_ACTIVE_SYM)
if db.IsNotFound(err) {
publicKey, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY)
if err != nil {
@ -1958,6 +1960,8 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
return res, nil
}
logg.InfoCtxf(ctx, "fetched user vouchers in SetDefaultVoucher", "public_key", string(publicKey), "vouchers", vouchersResp)
// Return if there is no voucher
if len(vouchersResp) == 0 {
res.FlagSet = append(res.FlagSet, flag_no_active_voucher)
@ -2007,6 +2011,8 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
return res, err
}
logg.InfoCtxf(ctx, "The activeSym:", "activeSym", string(activeSym))
res.FlagReset = append(res.FlagReset, flag_no_active_voucher)
return res, nil