diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 90318dba5..58fd28e00 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -464,6 +464,7 @@ define([ store.anon_rpc.send("GET_FILE_SIZE", channelId, function (e, response) { if (e) { return void cb({error: e}); } if (response && response.length && typeof(response[0]) === 'number') { + if (response[0] === 0) { Cache.clearChannel(channelId); } return void cb({size: response[0]}); } else { cb({error: 'INVALID_RESPONSE'}); @@ -477,6 +478,7 @@ define([ store.anon_rpc.send("IS_NEW_CHANNEL", channelId, function (e, response) { if (e) { return void cb({error: e}); } if (response && response.length && typeof(response[0]) === 'boolean') { + if (response[0]) { Cache.clearChannel(channelId); } return void cb({ isNew: response[0] }); diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 44cbb3e3c..b7610f684 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -480,6 +480,7 @@ define([ // We've received a link without /p/ and it doesn't work without a password: abort return void todo(); } + // Wrong password or deleted file? askPassword(true, passwordCfg); })); @@ -534,6 +535,12 @@ define([ var edPublic, curvePublic, notifications, isTemplate; var settings = {}; var isSafe = ['debug', 'profile', 'drive', 'teams'].indexOf(currentPad.app) !== -1; + + var isDeleted = isNewFile && currentPad.hash.length > 0; + if (isDeleted) { + Utils.Cache.clearChannel(secret.channel); + } + var updateMeta = function () { //console.log('EV_METADATA_UPDATE'); var metaObj; @@ -577,7 +584,7 @@ define([ upgradeURL: Cryptpad.upgradeURL }, isNewFile: isNewFile, - isDeleted: isNewFile && currentPad.hash.length > 0, + isDeleted: isDeleted, password: password, channel: secret.channel, enableSF: localStorage.CryptPad_SF === "1", // TODO to remove when enabled by default