mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Pad: Remove unneccessary padManager.getPad()
call
This commit is contained in:
parent
449b972e6a
commit
5f60b3aab2
1 changed files with 1 additions and 6 deletions
|
@ -477,8 +477,6 @@ Pad.prototype.copyAuthorInfoToDestinationPad = async function (destinationID) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Pad.prototype.copyPadWithoutHistory = async function (destinationID, force) {
|
Pad.prototype.copyPadWithoutHistory = async function (destinationID, force) {
|
||||||
const sourceID = this.id;
|
|
||||||
|
|
||||||
// flush the source pad
|
// flush the source pad
|
||||||
this.saveToDatabase();
|
this.saveToDatabase();
|
||||||
|
|
||||||
|
@ -488,9 +486,6 @@ Pad.prototype.copyPadWithoutHistory = async function (destinationID, force) {
|
||||||
// if force is true and already exists a Pad with the same id, remove that Pad
|
// if force is true and already exists a Pad with the same id, remove that Pad
|
||||||
await this.removePadIfForceIsTrueAndAlreadyExist(destinationID, force);
|
await this.removePadIfForceIsTrueAndAlreadyExist(destinationID, force);
|
||||||
|
|
||||||
const sourcePad = await padManager.getPad(sourceID);
|
|
||||||
|
|
||||||
// add the new sourcePad to all authors who contributed to the old one
|
|
||||||
await this.copyAuthorInfoToDestinationPad(destinationID);
|
await this.copyAuthorInfoToDestinationPad(destinationID);
|
||||||
|
|
||||||
// Group pad? Add it to the group's list
|
// Group pad? Add it to the group's list
|
||||||
|
@ -500,7 +495,7 @@ Pad.prototype.copyPadWithoutHistory = async function (destinationID, force) {
|
||||||
|
|
||||||
// initialize the pad with a new line to avoid getting the defaultText
|
// initialize the pad with a new line to avoid getting the defaultText
|
||||||
const newPad = await padManager.getPad(destinationID, '\n');
|
const newPad = await padManager.getPad(destinationID, '\n');
|
||||||
newPad.pool = sourcePad.pool.clone();
|
newPad.pool = this.pool.clone();
|
||||||
|
|
||||||
const oldAText = this.atext;
|
const oldAText = this.atext;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue