From df31281ef811bc1f4be98b7daab7b3b54586d479 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Fri, 27 Apr 2018 05:42:18 +0000 Subject: [PATCH] If volunteer has no hours for new year and is a member, this assings 0 to remaining. * otherwise spinner spins infinitely, and membership discount is not applied. --- js/transaction.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/transaction.js b/js/transaction.js index 73c20ed..7f739e8 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -1090,13 +1090,17 @@ $(function() { if (obj.volunteer) { volunteer = $.parseJSON(obj.volunteer); if (volunteer.hasOwnProperty(year)) { - remaining = obj.current_year_volunteer_hours - volunteer[year].volunteer_hours_redeemed; + remaining = obj.current_year_volunteer_hours - volunteer[year].volunteer_hours_redeemed; vhr = volunteer[year].volunteer_hours_redeemed; max_bikes_earned = volunteer[year].max_bike_earned; } } else { vhr = 0; - } + } + + if (obj.current_year_volunteer_hours === null) { + remaining = 0; + } var title = obj.normal_full_name + "\r\n" + obj.email + "\r\n" +