Skip to content

Commit

Permalink
fix: createReader시 로딩이 더 걸린다 그에 맞게 로딩 컴포넌트 표시 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
coddingyun committed Oct 31, 2023
1 parent 3d4a4a3 commit f33b454
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/annotation-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src/index.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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) {
Expand Down Expand Up @@ -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)
Expand All @@ -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));
},
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f33b454

Please sign in to comment.