aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js4
-rw-r--r--lib/serve.js2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/app.js b/lib/app.js
index b3cd1b1..8ac01d6 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -182,8 +182,8 @@ var stateVals = {
function comparePeers(a, b) {
var aState = stateVals[a.state] || 0
var bState = stateVals[b.state] || 0
- return bState > aState ? 1 : bState < aState ? -1 :
- b.stateChange - a.stateChange
+ return (bState - aState)
+ || (b.stateChange|0 - a.stateChange|0)
}
App.prototype.streamPeers = function (opts) {
diff --git a/lib/serve.js b/lib/serve.js
index 99755c0..7879377 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -375,7 +375,7 @@ Serve.prototype.peers = function (ext) {
peer.client ? '→' : '←', ' ',
h('code', peer.host, ':', peer.port, ':'),
self.app.render.idLink(peer.key, done()), ' ',
- htime(new Date(peer.stateChange)), ' ',
+ peer.stateChange ? [htime(new Date(peer.stateChange)), ' '] : '',
peer.state === 'connected' ? 'connected' : [
h('input', {name: 'action', type: 'submit', value: 'connect'}),
h('input', {name: 'address', type: 'hidden', value: addr})