diff --git a/src/lib/viewers/BaseViewer.js b/src/lib/viewers/BaseViewer.js index a4c235ac1..4f5268026 100644 --- a/src/lib/viewers/BaseViewer.js +++ b/src/lib/viewers/BaseViewer.js @@ -1105,9 +1105,6 @@ class BaseViewer extends EventEmitter { // Only on success do we exit create annotation mode. If error occurs, // we remain in create mode if (status === 'success') { - const activeMode = this.annotationControls.getActiveMode(); - this.annotator.toggleAnnotationMode(activeMode); - this.annotationControls.resetControls(); this.annotator.emit('annotations_active_set', id); } } diff --git a/src/lib/viewers/__tests__/BaseViewer-test.js b/src/lib/viewers/__tests__/BaseViewer-test.js index 2e2f833d7..87da25b6e 100644 --- a/src/lib/viewers/__tests__/BaseViewer-test.js +++ b/src/lib/viewers/__tests__/BaseViewer-test.js @@ -1495,13 +1495,7 @@ describe('lib/viewers/BaseViewer', () => { describe('handleAnnotationCreateEvent()', () => { beforeEach(() => { - base.annotationControls = { - getActiveMode: sandbox.stub(), - resetControls: sandbox.stub(), - }; - base.annotator = { - toggleAnnotationMode: sandbox.stub(), emit: sandbox.stub(), }; }); @@ -1518,22 +1512,14 @@ describe('lib/viewers/BaseViewer', () => { const event = createEvent(status); base.handleAnnotationCreateEvent(event); - expect(base.annotationControls.getActiveMode).not.to.be.called; - expect(base.annotator.toggleAnnotationMode).not.to.be.called; - expect(base.annotationControls.resetControls).not.to.be.called; expect(base.annotator.emit).not.to.be.called; }); }); it('should reset controls if status is success', () => { - base.annotationControls.getActiveMode.returns('region'); - const event = createEvent('success'); base.handleAnnotationCreateEvent(event); - expect(base.annotationControls.getActiveMode).to.be.called; - expect(base.annotator.toggleAnnotationMode).to.be.calledWith('region'); - expect(base.annotationControls.resetControls).to.be.called; expect(base.annotator.emit).to.be.calledWith('annotations_active_set', '123'); }); });