Recover from broken checkpoints in sheets

pull/1/head
yflory 4 years ago
parent dcd6c15dc9
commit 3ff889568f

@ -369,7 +369,8 @@ define([
content.hashes[i] = { content.hashes[i] = {
file: data.url, file: data.url,
hash: ev.hash, hash: ev.hash,
index: ev.index index: ev.index,
version: NEW_VERSION
}; };
oldHashes = JSON.parse(JSON.stringify(content.hashes)); oldHashes = JSON.parse(JSON.stringify(content.hashes));
content.locks = {}; content.locks = {};
@ -596,7 +597,13 @@ define([
if (arrayBuffer) { if (arrayBuffer) {
var u8 = new Uint8Array(arrayBuffer); var u8 = new Uint8Array(arrayBuffer);
FileCrypto.decrypt(u8, key, function (err, decrypted) { FileCrypto.decrypt(u8, key, function (err, decrypted) {
if (err) { return void console.error(err); } if (err) {
if (err === "DECRYPTION_ERROR") {
console.warn(err);
return void onCpError(err);
}
return void console.error(err);
}
var blob = new Blob([decrypted.content], {type: 'plain/text'}); var blob = new Blob([decrypted.content], {type: 'plain/text'});
if (cb) { if (cb) {
return cb(blob, getFileType()); return cb(blob, getFileType());

Loading…
Cancel
Save