From c35e3d644eada9eabd7dbcd15d212197750a9d76 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 20 Nov 2017 15:37:23 +0100 Subject: [PATCH] Make sure dates are stored as numbers in the drive --- www/common/cryptpad-common.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index de8a564d7..361132d12 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -358,18 +358,18 @@ define([ * ??? // what else can we put in here? */ var checkObjectData = function (pad, cb) { + if (typeof(pad.atime) !== "number") { pad.atime = +new Date(pad.atime); } if (!pad.ctime) { pad.ctime = pad.atime; } - if (/^https*:\/\//.test(pad.href)) { - pad.href = Hash.getRelativeHref(pad.href); - } + if (typeof(pad.actime) !== "number") { pad.ctime = +new Date(pad.ctime); } + + if (/^https*:\/\//.test(pad.href)) { pad.href = Hash.getRelativeHref(pad.href); } + var parsed = Hash.parsePadUrl(pad.href); if (!parsed || !parsed.hash) { return; } - if (typeof(cb) === 'function') { - cb(parsed); - } - if (!pad.title) { - pad.title = common.getDefaultName(parsed); - } + if (typeof(cb) === 'function') { cb(parsed); } + + if (!pad.title) { pad.title = common.getDefaultName(parsed); } + return parsed.hashData; }; // Remove everything from RecentPads that is not an object and check the objects