Fix scrambled data in sheets on reconnect

pull/1/head
yflory 3 years ago
parent 4c915f9e5a
commit ca95af082d

@ -1156,6 +1156,14 @@ define([
}; };
var handleChanges = function (obj, send) { var handleChanges = function (obj, send) {
if (APP.history) {
send({
type: "unSaveLock",
index: ooChannel.cpIndex,
time: +new Date()
});
return;
}
// Add a new entry to the pendingChanges object. // Add a new entry to the pendingChanges object.
// If we can't send the patch within 30s, force a page reload // If we can't send the patch within 30s, force a page reload
var uid = Util.uid(); var uid = Util.uid();

@ -87,8 +87,10 @@ define([
chan.wc = wc; chan.wc = wc;
chan.sendMsg = function (msg, cb) { chan.sendMsg = function (msg, cb) {
cb = cb || function () {}; cb = cb || function () {};
var hash = msg.slice(0, 64);
wc.bcast(msg).then(function () { wc.bcast(msg).then(function () {
chan.history.push(msg); chan.history.push(msg);
chan.lastKnownHash = hash;
cb(); cb();
}, function (err) { }, function (err) {
cb({error: err}); cb({error: err});

Loading…
Cancel
Save