Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
fix(getWADORSImageUrl): Handle frame numbers that come in as strings
Browse files Browse the repository at this point in the history
This surfaced as a result of some recent changes in ohif/Viewers Viewer.js. With those changes it
turned out that clearing the annotation was the first time that instance.getImageId() was called.
This sent it through a different execution path that was provided the frame number as a string,
exposing the issue this PR resolves.
  • Loading branch information
dlwire committed Jul 24, 2019
1 parent 2a2e6bb commit 3565b3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/getWADORSImageId.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function getWADORSImageUrl(instance, frame) {
}

// We need to sum 1 because WADO-RS frame number is 1-based
frame = (frame || 0) + 1;
frame = frame ? parseInt(frame) + 1 : 1;

// Replaces /frame/1 by /frame/{frame}
wadorsuri = wadorsuri.replace(/frames\/(\d+)/, `frames/${frame}`);
Expand Down

0 comments on commit 3565b3a

Please sign in to comment.