Skip to content

Commit

Permalink
Feat: send current pageIndex when view is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
coddingyun committed Oct 11, 2023
1 parent e927729 commit b44a21a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/common/annotation-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { postApi } from '../custom/utils/apiFetch'

let api = '';
if (process.env.NODE_ENV === 'development'){
//api = 'https://be.yeondoo.net'
api = 'https://virtserver.swaggerhub.com/SYLEELSW_1/Yeondoo/2.0'
api = 'https://be.yeondoo.net'
//api = 'https://virtserver.swaggerhub.com/SYLEELSW_1/Yeondoo/2.0'
}
else if (process.env.NODE_ENV === 'production'){
api = `${process.env.VITE_REACT_APP_AWS_SERVER}`
Expand Down
11 changes: 9 additions & 2 deletions src/index.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ window.dev = true;

let api = '';
if (process.env.NODE_ENV === 'development'){
//api = 'https://be.yeondoo.net'
api = 'https://virtserver.swaggerhub.com/SYLEELSW_1/Yeondoo/2.0'
api = 'https://be.yeondoo.net'
//api = 'https://virtserver.swaggerhub.com/SYLEELSW_1/Yeondoo/2.0'
}
else if (process.env.NODE_ENV === 'production'){
api = `${process.env.VITE_REACT_APP_AWS_SERVER}`
Expand Down Expand Up @@ -70,6 +70,10 @@ const receiveBasicInfo = async(e) => {

//createReader(paperId, [...paperItemsWithTag, e.data.chatNote])
}
// if (e.data.needPaperIndex) {
// reader.
// window.parent.postMessage({pageIndex: 0}, '*')
// }
}

window.addEventListener("message", receiveBasicInfo);
Expand Down Expand Up @@ -155,6 +159,9 @@ async function createReader(paperId, paperItems) {
console.log('Delete annotations', JSON.stringify(ids));
},
onChangeViewState: function (state, primary) {
if (state){
window.parent.postMessage({pageIndex: state.pageIndex}, '*')
}
console.log('Set state', state, primary);
},
onOpenTagsPopup(annotationID, left, top) {
Expand Down

0 comments on commit b44a21a

Please sign in to comment.