From 7c76e4544ac3fe0d10bd09f3d69318e81be53857 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 12 Mar 2020 15:53:59 +0100 Subject: [PATCH] Fix trim history --- www/common/common-ui-elements.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index c684ac32c..c3dff9ac6 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -146,6 +146,17 @@ define([ if (data.href) { data.href = base + data.href; } if (data.roHref) { data.roHref = base + data.roHref; } }), opts.href); + + // If this is a file, don't try to look for metadata + if (opts.channel && opts.channel.length > 34) { return; } + common.getPadMetadata({ + channel: opts.channel // optional, fallback to current pad + }, waitFor(function (obj) { + if (obj && obj.error) { return; } + data.owners = obj.owners; + data.expire = obj.expire; + data.pending_owners = obj.pending_owners; + })); }).nThen(function () { cb(void 0, data); });