Misc fixups
This commit is contained in:
parent
cfd5ca4670
commit
b8237b18b1
@ -25,7 +25,7 @@
|
||||
<iframe src="/profile.html" width="100%" height="250" frameborder="0"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-danger" id="resetStorage">Reset</button>
|
||||
<button class="btn btn-warning" id="resetStorage">Reset</button>
|
||||
<button class="btn btn-default" data-dismiss="modal">Accept</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -235,7 +235,7 @@ function computeRecordCompat(records, context, callback) {
|
||||
|
||||
function fixupProfile(profile) {
|
||||
var fixed = {};
|
||||
_.each(JSON.parse(profile), function(value, key) {
|
||||
_.each(JSON.parse(profile || '{}'), function(value, key) {
|
||||
if (parseFloat(value) !== 0) {
|
||||
fixed[key] = value;
|
||||
}
|
||||
@ -255,9 +255,13 @@ function fixupFeatures(features) {
|
||||
'compatible'
|
||||
];
|
||||
|
||||
if (!features) {
|
||||
features = {};
|
||||
}
|
||||
|
||||
var fixed = {};
|
||||
_.each(keys, function(key) {
|
||||
fixed[key] = _.has(features, key) ? features[key] : 0;
|
||||
fixed[key] = features[key] || 0;
|
||||
});
|
||||
|
||||
return fixed;
|
||||
@ -270,7 +274,10 @@ function getCategories(callback) {
|
||||
}
|
||||
|
||||
var categories = _.map(rows, function(row) {
|
||||
return {id: row.id, description: row.description};
|
||||
return {
|
||||
id: row.id,
|
||||
description: row.description
|
||||
};
|
||||
});
|
||||
|
||||
callback(categories);
|
||||
|
Loading…
Reference in New Issue
Block a user