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)) {
|
||||
name = this.rider_names[id];
|
||||
callback(name);
|
||||
}
|
||||
} else {
|
||||
// ajax call to get it
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: rider_url
|
||||
}).done(function(response) {
|
||||
name = response.rider_name;
|
||||
|
||||
// ajax call to get it
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: rider_url
|
||||
}).done(function(response) {
|
||||
name = response.rider_name;
|
||||
my.rider_names[id] = name;
|
||||
callback(name);
|
||||
});
|
||||
// set name in cache
|
||||
my.rider_names[id] = name;
|
||||
callback(name);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue