Fix caching for rider marker name loading #472
This commit is contained in:
parent
78554ec9c6
commit
b6d2726d41
1 changed files with 12 additions and 10 deletions
|
|
@ -335,16 +335,18 @@ class DashboardMap {
|
||||||
if (this.rider_names.hasOwnProperty(id)) {
|
if (this.rider_names.hasOwnProperty(id)) {
|
||||||
name = this.rider_names[id];
|
name = this.rider_names[id];
|
||||||
callback(name);
|
callback(name);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// ajax call to get it
|
// ajax call to get it
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: rider_url
|
url: rider_url
|
||||||
}).done(function(response) {
|
}).done(function(response) {
|
||||||
name = response.rider_name;
|
name = response.rider_name;
|
||||||
|
|
||||||
|
// set name in cache
|
||||||
my.rider_names[id] = name;
|
my.rider_names[id] = name;
|
||||||
callback(name);
|
callback(name);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue