diff --git a/src/lib/annotations/AnnotationThread.js b/src/lib/annotations/AnnotationThread.js index 83a4b33d2..677d2fda6 100644 --- a/src/lib/annotations/AnnotationThread.js +++ b/src/lib/annotations/AnnotationThread.js @@ -125,6 +125,7 @@ class AnnotationThread extends EventEmitter { */ hideDialog() { if (this.dialog) { + this.state = STATES.inactive; this.dialog.hide(); } } @@ -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(); diff --git a/src/lib/annotations/__tests__/AnnotationThread-test.js b/src/lib/annotations/__tests__/AnnotationThread-test.js index 86f4c5098..a7fa1c130 100644 --- a/src/lib/annotations/__tests__/AnnotationThread-test.js +++ b/src/lib/annotations/__tests__/AnnotationThread-test.js @@ -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); }); });