From 592707682ba55f8f05d6ae7e1c090152ac24d8db Mon Sep 17 00:00:00 2001 From: Thomas Scherz Date: Fri, 26 Jul 2024 10:27:09 -0400 Subject: [PATCH] Changes chaining in javascript. --- app/assets/javascripts/multivalueinputs.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/multivalueinputs.js b/app/assets/javascripts/multivalueinputs.js index 7a671b2..8ae7f8d 100644 --- a/app/assets/javascripts/multivalueinputs.js +++ b/app/assets/javascripts/multivalueinputs.js @@ -1,12 +1,10 @@ window.onload = function() { window.counts = { - - developers: window.counts?.developers || 1, - tech_leads: window.counts?.tech_leads || 1, - departments: window.counts?.departments || 1, - product_owners: window.counts?.product_owners || 1, - admin_users: window.counts?.admin_users || 1 - + developers: (window.counts && window.counts.developers) || 1, + tech_leads: (window.counts && window.counts.tech_leads) || 1, + departments: (window.counts && window.counts.departments) || 1, + product_owners: (window.counts && window.counts.product_owners) || 1, + admin_users: (window.counts && window.counts.admin_users) || 1 }; };