From 74b379999e298386ecc075841d98afd38eff189c Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 26 Jun 2020 15:42:50 +0200 Subject: [PATCH] Improve error message when opening an expired pad --- www/common/sframe-common-outer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 3fbba216d..26ffa07a2 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -288,7 +288,15 @@ define([ var newHref; var expire; nThen(function (w) { - if (parsed.hashData.key || !parsed.hashData.channel) { return; } + // If we're using an unsafe link, get pad attribute + if (parsed.hashData.key || !parsed.hashData.channel) { + Cryptpad.getPadAttribute('expire', w(function (err, data) { + if (err) { return; } + expire = data; + })); + return; + } + // Otherwise, get pad data from channel id var edit = parsed.hashData.mode === 'edit'; Cryptpad.getPadDataFromChannel({ channel: parsed.hashData.channel,