Compare commits
No commits in common. "025c32c5f0d60e9cc3d4e6e229e77cb2712e6af4" and "b8829e917b1fa138c722fab51fcfa46b5d6867f3" have entirely different histories.
025c32c5f0
...
b8829e917b
@ -45,26 +45,6 @@ func (h *MenuHandlers) ManageVouchers(ctx context.Context, sym string, input []b
|
||||
res.FlagReset = append(res.FlagReset, flag_api_error)
|
||||
|
||||
if len(vouchersResp) == 0 {
|
||||
// clear the current active voucher data if it exists
|
||||
_, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM)
|
||||
if err == nil {
|
||||
firstVoucherMap := map[storedb.DataTyp]string{
|
||||
storedb.DATA_ACTIVE_SYM: "",
|
||||
storedb.DATA_ACTIVE_BAL: "",
|
||||
storedb.DATA_ACTIVE_DECIMAL: "",
|
||||
storedb.DATA_ACTIVE_ADDRESS: "",
|
||||
}
|
||||
|
||||
for key, value := range firstVoucherMap {
|
||||
if err := userStore.WriteEntry(ctx, sessionId, key, []byte(value)); err != nil {
|
||||
logg.ErrorCtxf(ctx, "Failed to reset active voucher data", "key", key, "error", err)
|
||||
return res, err
|
||||
}
|
||||
}
|
||||
|
||||
logg.InfoCtxf(ctx, "Default voucher reset")
|
||||
}
|
||||
|
||||
res.FlagSet = append(res.FlagSet, flag_no_active_voucher)
|
||||
return res, nil
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user