Skip to content

Commit

Permalink
Merge pull request #600 from bcgov/dev-marshal-AS-4680
Browse files Browse the repository at this point in the history
Fix for single file view- No stitching scenario
  • Loading branch information
aparna-aot authored Nov 3, 2023
2 parents 761c246 + cb61524 commit d280204
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions web/src/components/FOI/Home/Redlining.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ const Redlining = React.forwardRef(
doclistCopy.length,
true
);
doclistCopy?.shift();
if(doclistCopy.length > 1)
doclistCopy?.shift();
let setCount = slicerdetails.setcount;
let slicer = slicerdetails.slicer;
console.log(`slicer = ${slicer}, setCount = ${setCount}`);
Expand Down Expand Up @@ -1259,12 +1260,21 @@ const Redlining = React.forwardRef(
docViewer
) {
let doclistCopy = [...docsForStitcing];
doclistCopy?.shift(); //remove first document from the list
let _pdftronDocObjects = sortDocObjects(pdftronDocObjects, doclistCopy);
if(doclistCopy.length > 1){
doclistCopy?.shift(); //remove first document from the list
let _pdftronDocObjects = sortDocObjects(pdftronDocObjects, doclistCopy);

const _doc = docViewer.getDocument();
if (_doc && _pdftronDocObjects.length > 0) {
stitchPages(_doc, _pdftronDocObjects);
const _doc = docViewer.getDocument();
if (_doc && _pdftronDocObjects.length > 0) {
stitchPages(_doc, _pdftronDocObjects);
}
}
else if (doclistCopy.length === 1){
console.log(`Download completed for single file.... ${new Date()}`);
applyAnnotationsFunc();
setIsStitchingLoaded(true);
setpdftronDocObjects([]);
setstichedfiles([]);
}
}
}, [
Expand Down

0 comments on commit d280204

Please sign in to comment.