Skip to content

Commit

Permalink
Chore: Force threads to be inactive when the dialog hides (#424)
Browse files Browse the repository at this point in the history
* Chore: Force threads to be inactive when the dialog hides and make sure threads are properly deleted on mobile
  • Loading branch information
pramodsum authored and Jeremy Press committed Oct 4, 2017
1 parent 04d3cc7 commit 90048ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/annotations/AnnotationThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class AnnotationThread extends EventEmitter {
*/
hideDialog() {
if (this.dialog) {
this.state = STATES.inactive;
this.dialog.hide();
}
}
Expand Down Expand Up @@ -210,8 +211,8 @@ class AnnotationThread extends EventEmitter {
// If this annotation was the last one in the thread, destroy the thread
} else if (this.annotations.length === 0 || annotatorUtil.isPlainHighlight(this.annotations)) {
if (this.isMobile && this.dialog) {
this.dialog.removeAnnotation(annotationID);
this.dialog.hideMobileDialog();
this.dialog.removeAnnotation(annotationID);
}
this.destroy();

Expand Down
1 change: 1 addition & 0 deletions src/lib/annotations/__tests__/AnnotationThread-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ describe('lib/annotations/AnnotationThread', () => {
it('should hide the thread dialog', () => {
stubs.dialogMock.expects('hide');
thread.hideDialog();
expect(thread.state).equals(STATES.inactive);
});
});

Expand Down

0 comments on commit 90048ec

Please sign in to comment.