Never store invalid OO checkpoints
parent
9a20b8a222
commit
d8eebe4e9c
|
@ -454,6 +454,18 @@ define([
|
|||
|
||||
var saveToServer = function () {
|
||||
var text = getContent();
|
||||
text = undefined;
|
||||
if (!text) {
|
||||
setEditable(false, true);
|
||||
sframeChan.query('Q_CLEAR_CACHE_CHANNELS', [
|
||||
'chainpad',
|
||||
content.channel,
|
||||
], function () {});
|
||||
UI.alert(Messages.realtime_unrecoverableError, function () {
|
||||
common.gotoURL();
|
||||
});
|
||||
return;
|
||||
}
|
||||
var blob = new Blob([text], {type: 'plain/text'});
|
||||
var file = getFileType();
|
||||
blob.name = (metadataMgr.getMetadataLazy().title || file.doc) + '.' + file.type;
|
||||
|
|
|
@ -1533,6 +1533,16 @@ define([
|
|||
sframeChan.on('Q_CLEAR_CACHE', function (data, cb) {
|
||||
Utils.Cache.clear(cb);
|
||||
});
|
||||
sframeChan.on('Q_CLEAR_CACHE_CHANNELS', function (channels, cb) {
|
||||
if (!Array.isArray(channels)) { return void cb({error: "NOT_AN_ARRAY"}); }
|
||||
nThen(function (waitFor) {
|
||||
channels.forEach(function (chan) {
|
||||
if (chan === "chainpad") { chan = secret.channel; }
|
||||
console.error(chan);
|
||||
Utils.Cache.clearChannel(chan, waitFor());
|
||||
});
|
||||
}).nThen(cb);
|
||||
});
|
||||
|
||||
sframeChan.on('Q_PIN_GET_USAGE', function (teamId, cb) {
|
||||
Cryptpad.isOverPinLimit(teamId, function (err, overLimit, data) {
|
||||
|
|
Loading…
Reference in New Issue