1

Adding workaround for GetJSON screwing up profile dictionary.

This commit is contained in:
Alex Yatskov 2015-03-17 13:57:50 +09:00
parent f6c9768fb8
commit 3973a4cee5
2 changed files with 10 additions and 7 deletions

View File

@ -149,7 +149,9 @@
}
function getProfile() {
return JSON.parse(localStorage.profile || '{}');
var profile = JSON.parse(localStorage.profile || '{}');
profile.serial = true;
return profile;
}
window.onpopstate = function(state) {

View File

@ -191,6 +191,7 @@ function computeRecordGeo(records, context) {
}
function computeRecordCompat(records, context, callback) {
console.log(context.profile);
async.map(
records,
function(record, callback) {
@ -231,7 +232,7 @@ function computeRecordCompat(records, context, callback) {
});
},
function(err, results) {
console.log(results);
// console.log(results);
callback(records);
}
);
@ -255,11 +256,11 @@ function sanitizeQuery(query) {
query.features = features;
for (var category in query.profile) {
if (parseFloat(query.profile[category]) === 0) {
delete query.profile[category];
}
}
// for (var category in query.profile) {
// if (parseFloat(query.profile[category]) === 0) {
// delete query.profile[category];
// }
// }
}
function getCategories(callback) {