From 5f60b3aab28f4065e4fd9beb4f89ecd5e9c6c42e Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 17 Feb 2022 14:16:30 -0500 Subject: [PATCH] Pad: Remove unneccessary `padManager.getPad()` call --- src/node/db/Pad.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js index 47c1f5d71..5e6a8840b 100644 --- a/src/node/db/Pad.js +++ b/src/node/db/Pad.js @@ -477,8 +477,6 @@ Pad.prototype.copyAuthorInfoToDestinationPad = async function (destinationID) { }; Pad.prototype.copyPadWithoutHistory = async function (destinationID, force) { - const sourceID = this.id; - // flush the source pad 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 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); // 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 const newPad = await padManager.getPad(destinationID, '\n'); - newPad.pool = sourcePad.pool.clone(); + newPad.pool = this.pool.clone(); const oldAText = this.atext;