From 235c04f2ad9148d226d270b8753ddcaebc0533e4 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 29 Oct 2024 11:20:12 +0100 Subject: [PATCH] Fix placeholder issues --- lib/hk-util.js | 3 ++- www/cryptpad-api.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/hk-util.js b/lib/hk-util.js index 93c3f9c0e..069be04a3 100644 --- a/lib/hk-util.js +++ b/lib/hk-util.js @@ -143,7 +143,8 @@ const dropChannel = HK.dropChannel = function (Env, chanName) { delete Env.channel_cache[chanName]; if (meta && meta.selfdestruct && Env.selfDestructTo) { Env.selfDestructTo[chanName] = setTimeout(function () { - expireChannel(Env, chanName); + if (!Env.store) { return; } + Env.store.archiveChannel(chanName, false, () => {}); }, TEMPORARY_CHANNEL_LIFETIME); } if (Env.store) { Env.store.closeChannel(chanName, function () {}); } diff --git a/www/cryptpad-api.js b/www/cryptpad-api.js index e73ef40bd..9dfcc55b9 100644 --- a/www/cryptpad-api.js +++ b/www/cryptpad-api.js @@ -131,7 +131,10 @@ return start(); } getBlob(function (err, _blob) { - if (err) { reject(err); return console.error(err); } + if (err) { // Can't get blob from client, try from server + console.warn(err); + return void start(); + } _blob.name = `document.${config.document.fileType}`; blob = _blob; start();