mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
changeset.js: do not lose sync in the timeslider if another user deletes text
If a user deleted text/attributes while another one had the timeslider open, the timeslider lost sync and spit out errors. Fixes #3932.
This commit is contained in:
parent
7bdc9d8a57
commit
452db293b0
1 changed files with 11 additions and 1 deletions
|
@ -1529,7 +1529,17 @@ exports.moveOpsToNewPool = function (cs, oldPool, newPool) {
|
||||||
return upToDollar.replace(/\*([0-9a-z]+)/g, function (_, a) {
|
return upToDollar.replace(/\*([0-9a-z]+)/g, function (_, a) {
|
||||||
var oldNum = exports.parseNum(a);
|
var oldNum = exports.parseNum(a);
|
||||||
var pair = oldPool.getAttrib(oldNum);
|
var pair = oldPool.getAttrib(oldNum);
|
||||||
if(!pair) exports.error('Can\'t copy unknown attrib (reference attrib string to non-existant pool entry). Inconsistent attrib state!');
|
|
||||||
|
/*
|
||||||
|
* Setting an empty pair. Required for when delete pad contents / attributes
|
||||||
|
* while another user has the timeslider open.
|
||||||
|
*
|
||||||
|
* Fixes https://github.com/ether/etherpad-lite/issues/3932
|
||||||
|
*/
|
||||||
|
if (!pair) {
|
||||||
|
pair = [];
|
||||||
|
}
|
||||||
|
|
||||||
var newNum = newPool.putAttrib(pair);
|
var newNum = newPool.putAttrib(pair);
|
||||||
return '*' + exports.numToString(newNum);
|
return '*' + exports.numToString(newNum);
|
||||||
}) + fromDollar;
|
}) + fromDollar;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue