From d8b467422a0440e6a7a5b59113b03ea894a69e64 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 4 Jul 2016 16:43:39 +0200 Subject: [PATCH] fix default title in localStorage migration --- www/common/cryptpad-common.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 285f8f5cf..72ee7e0d3 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -40,10 +40,16 @@ define([ var migrateRecentPads = common.migrateRecentPads = function (pads) { return pads.map(function (pad) { if (isArray(pad)) { + var href = pad[0]; + var hash; + href.replace(/\#(.*)$/, function (a, h) { + hash = h; + }); + return { href: pad[0], atime: pad[1], - title: pad[2] || '', + title: pad[2] || hash && hash.slice(0,8), ctime: pad[1], }; } else if (typeof(pad) === 'object') {