From 94778d711c278fe480b8bf656e881cdd8a4faeb6 Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Mon, 20 May 2024 16:31:04 -0500 Subject: [PATCH] fixup ss import --- backend/src/api/import-from-ss.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/api/import-from-ss.js b/backend/src/api/import-from-ss.js index 89e4b0a..f9a261a 100644 --- a/backend/src/api/import-from-ss.js +++ b/backend/src/api/import-from-ss.js @@ -135,10 +135,10 @@ const addPostWithRetry = async (authors, hash, references, retryDelay = 5000) => const importPaper = async (paper) => { console.log('references count:', paper.references.length); const { paperId } = paper; - const references = paper.references.filter((x) => !!x.paperId); - const eachReferenceWeightPPM = Math.floor(PPM_TO_REFERENCES / references.length); + const paperReferences = paper.references.filter((x) => !!x.paperId); + const eachReferenceWeightPPM = Math.floor(PPM_TO_REFERENCES / paperReferences.length); const references = (await Promise.mapSeries( - references, + paperReferences, async (citedPaper) => { // We need to fetch this paper so we can generate the post we WOULD add to the forum. // That way, if we later add the cited paper to the blockchain it will have the correct hash.