Search again if no tel selected

Stephen Paul Weber created

Change summary

lib/tel_selections.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Detailed changes

lib/tel_selections.rb 🔗

@@ -55,9 +55,10 @@ class TelSelections
 				reply.allowed_actions = [:next, :prev]
 				reply.command << FormTemplate.render("tn_list", tns: tns)
 			}.then { |iq|
-				next choose_tel if iq.prev?
+				tel = iq.form.field("tel")&.value
+				next choose_tel if iq.prev? || !tel
 
-				iq.form.field("tel").value.to_s.strip
+				tel.to_s.strip
 			}
 		end