Compare commits
2 Commits
v1.0.0-rc
...
v1.0.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f37856927
|
||
|
|
e564f1328b
|
@@ -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
|
||||
@@ -2034,6 +2040,8 @@ func (h *MenuHandlers) CheckVouchers(ctx context.Context, sym string, input []by
|
||||
return res, nil
|
||||
}
|
||||
|
||||
logg.InfoCtxf(ctx, "fetched user vouchers", "public_key", string(publicKey), "vouchers", vouchersResp)
|
||||
|
||||
// check the current active sym and update the data
|
||||
activeSym, _ := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM)
|
||||
if activeSym != nil {
|
||||
|
||||
Reference in New Issue
Block a user