refactor(admin_command): simplify to ternary

Amolith created

registered? never returns nil, no need to handle it

Change summary

lib/admin_command.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

lib/admin_command.rb 🔗

@@ -87,7 +87,7 @@ class AdminCommand
 
 		reg = @target_customer.registered?
 		vars = { notice: notice, customer_id: @target_customer.customer_id,
-		         jid: @target_customer.jid, tel: (reg || nil)&.phone }
+		         jid: @target_customer.jid, tel: reg ? reg.phone : nil }
 		reply(FormTemplate.render("admin_menu", **vars)).then do |response|
 			if response.form.field("action")
 				handle(response.form.field("action").value, response.action)