From d03c0c4c0e9f6794ee9280968368fc6e84ae3a99 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Mon, 19 May 2025 15:42:43 +0200 Subject: [PATCH] vouchers-input-selection (#75) - Update the NEXT and PREV input selectors on the vouchers list - Have the INCMPs before LOAD/RELOADs to prevent navigation inputs being passed to handler functions Reviewed-on: https://git.grassecon.net/grassrootseconomics/sarafu-vise/pulls/75 Reviewed-by: Mohamed Sohail Co-authored-by: alfred-mk Co-committed-by: alfred-mk --- handlers/application/menuhandler.go | 4 ---- services/registration/select_voucher.vis | 12 ++++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index ba70bf8..ba31717 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -2181,10 +2181,6 @@ func (h *MenuHandlers) ViewVoucher(ctx context.Context, sym string, input []byte flag_incorrect_voucher, _ := h.flagManager.GetFlag("flag_incorrect_voucher") inputStr := string(input) - if inputStr == "0" || inputStr == "99" { - res.FlagReset = append(res.FlagReset, flag_incorrect_voucher) - return res, nil - } metadata, err := store.GetVoucherData(ctx, h.userdataStore, sessionId, inputStr) if err != nil { diff --git a/services/registration/select_voucher.vis b/services/registration/select_voucher.vis index 058d791..0edb553 100644 --- a/services/registration/select_voucher.vis +++ b/services/registration/select_voucher.vis @@ -3,14 +3,14 @@ LOAD get_vouchers 0 MAP get_vouchers MOUT back 0 MOUT quit 99 -MNEXT next 11 -MPREV prev 22 +MNEXT next 88 +MPREV prev 98 HALT +INCMP > 88 +INCMP < 98 +INCMP _ 0 +INCMP quit 99 LOAD view_voucher 80 RELOAD view_voucher CATCH . flag_incorrect_voucher 1 -INCMP _ 0 -INCMP quit 99 -INCMP > 11 -INCMP < 22 INCMP view_voucher *