Merge branch 'soon' of github.com:xwiki-labs/cryptpad into soon

This commit is contained in:
ansuz 2020-12-14 18:41:22 +05:30
commit c604df1865
3 changed files with 12 additions and 3 deletions

View file

@ -318,8 +318,8 @@ button:not(.btn).primary:hover{
// Make sure progress doesn't go backward
var c = types.indexOf(data.type);
if (c < current) { return console.error(data); }
if (c === current && progress > data.progress) { return console.error(data); }
if (c < current) { return console.debug(data); }
if (c === current && progress > data.progress) { return console.debug(data); }
progress = data.progress;
try {

View file

@ -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]
});

View file

@ -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