Browse Source

Indent map

pm2
Luke Childs 9 years ago
parent
commit
081574acf9
  1. 19
      viewModels/listing.js

19
viewModels/listing.js

@ -12,15 +12,16 @@ module.exports = (req, res) => {
return Promise.all(nodes.map(node => onionoo.details({ lookup: node.f || node.h }))); return Promise.all(nodes.map(node => onionoo.details({ lookup: node.f || node.h })));
}) })
.then(summaryDetails => { .then(summaryDetails => {
const nodes = summaryDetails.map(details => { const nodes = summaryDetails
if(details.relays[0]) { .map(details => {
details.relays[0].type = 'relay'; if(details.relays[0]) {
return details.relays[0]; details.relays[0].type = 'relay';
} else if(details.bridges[0]) { return details.relays[0];
details.bridges[0].type = 'bridge'; } else if(details.bridges[0]) {
return details.bridges[0]; details.bridges[0].type = 'bridge';
} return details.bridges[0];
}); }
});
return res.render('listing.html', { nodes: nodes }); return res.render('listing.html', { nodes: nodes });
}); });
} }

Loading…
Cancel
Save