Skip to content

Commit

Permalink
Merge pull request #279 from samvera-labs/canvas-not-found
Browse files Browse the repository at this point in the history
Fix missing canvas console error
  • Loading branch information
masaball authored Nov 7, 2023
2 parents 2bd19ec + e369bd5 commit d8e7618
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/services/iiif-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function canvasesInManifest(manifest) {
/**
* Get isMultiCanvas and last canvas index information from the
* given Manifest
* @param {Object} manifest
* @param {Object} manifest
* @returns {Object} { isMultiCanvas: Boolean, lastIndex: Number }
*/
export function manifestCanvasesInfo(manifest) {
Expand All @@ -68,16 +68,16 @@ export function manifestCanvasesInfo(manifest) {

/**
* Get canvas index by using the canvas id
* @param {Object} manifest
* @param {String} canvasId
* @param {Object} manifest
* @param {String} canvasId
* @returns {Number} canvasindex
*/
export function getCanvasIndex(manifest, canvasId) {
try {
const sequences = parseManifest(manifest).getSequences();
if (sequences && sequences != undefined) {
let canvasindex = sequences[0].getCanvasIndexById(canvasId);
if (canvasindex) {
if (canvasindex || canvasindex === 0) {
return canvasindex;
} else {
console.log('Canvas not found in Manifest, ', canvasId);
Expand Down Expand Up @@ -442,8 +442,8 @@ export function parseAutoAdvance(manifest) {
/**
* Parse 'structures' into an array of nested JSON objects with
* required information for structured navigation UI rendering
* @param {Object} manifest
* @returns {Object}
* @param {Object} manifest
* @returns {Object}
* obj.structures: a nested json object structure derived from
* 'structures' property in the given Manifest
* obj.timespans: timespan items linking to Canvas
Expand Down

0 comments on commit d8e7618

Please sign in to comment.