mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-22 08:53:23 -05:00
A similar bug was fixed in d0028b57790
* With new SQL logic volunteer obj is empty for non-volunteers, this corrects this by creating false empty data in an new temp. object.
This commit is contained in:
parent
937bf5adff
commit
39234f9b10
@ -1039,8 +1039,14 @@ $(function() {
|
||||
var bikes_earned = 0;
|
||||
var volunteer_hours_redeemed = 0;
|
||||
|
||||
var volunteer_objs = $.parseJSON(data);
|
||||
var obj = volunteer_objs[0];
|
||||
var volunteer_objs = $.parseJSON(data);
|
||||
|
||||
/*
|
||||
Weird hack, before improving performance #46, there was always a property for obj,
|
||||
?, which just allowed the code to work, now it is empty when a patron
|
||||
has never been a volunteer, so this creates that obj & property if that is the case.
|
||||
*/
|
||||
var obj = volunteer_objs[0] || { volunteer: "" };
|
||||
|
||||
var volunteer = "", remaining = 0, vhr = "", max_bikes_earned = 0;
|
||||
if (obj.volunteer) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user