mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-22 17:03:22 -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
@ -1040,7 +1040,13 @@ $(function() {
|
|||||||
var volunteer_hours_redeemed = 0;
|
var volunteer_hours_redeemed = 0;
|
||||||
|
|
||||||
var volunteer_objs = $.parseJSON(data);
|
var volunteer_objs = $.parseJSON(data);
|
||||||
var obj = volunteer_objs[0];
|
|
||||||
|
/*
|
||||||
|
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;
|
var volunteer = "", remaining = 0, vhr = "", max_bikes_earned = 0;
|
||||||
if (obj.volunteer) {
|
if (obj.volunteer) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user