From f33b45408219f6f93bfe9a83ff18bd32936a33d1 Mon Sep 17 00:00:00 2001 From: coddingyun Date: Tue, 31 Oct 2023 13:44:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20createReader=EC=8B=9C=20=EB=A1=9C?= =?UTF-8?q?=EB=94=A9=EC=9D=B4=20=EB=8D=94=20=EA=B1=B8=EB=A6=B0=EB=8B=A4=20?= =?UTF-8?q?=EA=B7=B8=EC=97=90=20=EB=A7=9E=EA=B2=8C=20=EB=A1=9C=EB=94=A9=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=ED=91=9C=EC=8B=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/annotation-manager.js | 1 + src/index.dev.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/annotation-manager.js b/src/common/annotation-manager.js index de45d51e..ee8e4ff9 100644 --- a/src/common/annotation-manager.js +++ b/src/common/annotation-manager.js @@ -132,6 +132,7 @@ class AnnotationManager { const paperId = sessionStorage.getItem('paperId') const workspaceId = sessionStorage.getItem('workspaceId') + //refresh api 넣기 postApi(api, `/api/paper/item?paperId=${paperId}&workspaceId=${workspaceId}`, payload) .catch(error => { console.log(error) diff --git a/src/index.dev.js b/src/index.dev.js index e946d913..addcf699 100644 --- a/src/index.dev.js +++ b/src/index.dev.js @@ -57,7 +57,6 @@ const receiveBasicInfo = async(e) => { if (e.data.userPdf) { res = await fetch(`https://yeondoo-upload-pdf.s3.ap-northeast-2.amazonaws.com/${e.data.paperId}.pdf`); } else { - console.log('check') res = await fetch(`https://browse.arxiv.org/pdf/${e.data.paperId}.pdf`); } const newData = { @@ -69,6 +68,7 @@ const receiveBasicInfo = async(e) => { window.parent.postMessage({isUpdatedDone: true}, '*') } else { createReader(e.data.paperId, paperItemsWithTag, e.data.userPdf); + // window.parent.postMessage({createReader: true}, '*') } } else if (e.data.chatNote) { @@ -178,6 +178,7 @@ async function createReader(paperId, paperItems, userPdf) { const paperId = sessionStorage.getItem('paperId') const workspaceId = sessionStorage.getItem('workspaceId') + //refresh api 넣기 putApi(api, `/api/paper/item?paperId=${paperId}&workspaceId=${workspaceId}`, payload) .catch(error => { console.log(error) @@ -189,6 +190,7 @@ async function createReader(paperId, paperItems, userPdf) { const paperId = sessionStorage.getItem('paperId') const workspaceId = sessionStorage.getItem('workspaceId') + //refresh api 넣기 deleteApi(api, `/api/paper/item?paperId=${paperId}&workspaceId=${workspaceId}&itemId=${ids}`) console.log('Delete annotations', JSON.stringify(ids)); }, @@ -227,6 +229,8 @@ async function createReader(paperId, paperItems, userPdf) { console.log('Deleting pages', pageIndexes, degrees); } }); + window.parent.postMessage({createReader: true}, '*') + reader.enableAddToNote(true); window._reader = reader; await reader.initializedPromise;