mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 16:36:15 -04:00
Pad: Fix copyPadWithoutHistory
apool corruption bug
This commit is contained in:
parent
ed78b56079
commit
dab881139d
4 changed files with 96 additions and 5 deletions
|
@ -492,10 +492,9 @@ Pad.prototype.copyPadWithoutHistory = async function (destinationID, force) {
|
|||
|
||||
// initialize the pad with a new line to avoid getting the defaultText
|
||||
const newPad = await padManager.getPad(destinationID, '\n');
|
||||
newPad.pool = sourcePad.pool.clone();
|
||||
|
||||
const oldAText = this.atext;
|
||||
const newPool = newPad.pool;
|
||||
newPool.fromJsonable(sourcePad.pool.toJsonable()); // copy that sourceId pool to the new pad
|
||||
|
||||
// based on Changeset.makeSplice
|
||||
const assem = Changeset.smartOpAssembler();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue