diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-07-10 13:35:33 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-07-10 13:35:33 -1000 |
commit | 99751530687fd14483071de4ae97c2caac667c92 (patch) | |
tree | f49a11e77e6adf3f43edbf3ba7299fea700d0096 | |
parent | 3e303fe722d3852f27a5f8ce86cbe0cc15584649 (diff) | |
download | patchfoo-99751530687fd14483071de4ae97c2caac667c92.tar.gz patchfoo-99751530687fd14483071de4ae97c2caac667c92.zip |
Improve links on about pages
-rw-r--r-- | lib/about.js | 5 | ||||
-rw-r--r-- | lib/util.js | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/about.js b/lib/about.js index 4ad153b..bb292f6 100644 --- a/lib/about.js +++ b/lib/about.js @@ -20,15 +20,14 @@ About.prototype.createAboutOpStream = function (id) { && key !== 'type' && key !== 'recps' }).map(function (key) { - var value = u.linkDest(c[key]) - // if (u.isRef(value)) value = {link: value} + var value = u.toLink(c[key]) return { id: msg.key, author: msg.value.author, timestamp: msg.value.timestamp, prop: key, value: value, - remove: value && typeof value === 'object' && value.remove, + remove: value && value.remove, } }) }), diff --git a/lib/util.js b/lib/util.js index 713705d..c6a4aa2 100644 --- a/lib/util.js +++ b/lib/util.js @@ -72,7 +72,7 @@ u.ifNumber = function (num) { } u.toLink = function (link) { - return typeof link === 'string' ? {link: link} : link + return typeof link === 'string' ? {link: link} : link || null } u.linkDest = function (link) { |