From 99751530687fd14483071de4ae97c2caac667c92 Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 10 Jul 2017 13:35:33 -1000 Subject: Improve links on about pages --- lib/about.js | 5 ++--- lib/util.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'lib') 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) { -- cgit v1.2.3