diff --git a/src/lib/Preview.js b/src/lib/Preview.js index 1705c3b0f..a628db179 100644 --- a/src/lib/Preview.js +++ b/src/lib/Preview.js @@ -1472,6 +1472,9 @@ class Preview extends EventEmitter { // Destroy anything still showing this.destroy(); + // Setup the preview ui for next/previous buttons + this.setupUI(); + // Instantiate the error viewer this.viewer = this.getErrorViewer(); diff --git a/src/lib/__tests__/Preview-test.js b/src/lib/__tests__/Preview-test.js index ee1d777ab..22b77f1ac 100644 --- a/src/lib/__tests__/Preview-test.js +++ b/src/lib/__tests__/Preview-test.js @@ -2180,6 +2180,7 @@ describe('lib/Preview', () => { stubs.emit = sandbox.stub(preview, 'emit'); stubs.emitPreviewError = sandbox.stub(preview, 'emitPreviewError'); stubs.attachViewerListeners = sandbox.stub(preview, 'attachViewerListeners'); + stubs.setupUI = sandbox.stub(preview, 'setupUI'); preview.open = true; }); @@ -2205,6 +2206,7 @@ describe('lib/Preview', () => { expect(preview.open).to.be.false; expect(stubs.uncacheFile).to.be.called; expect(stubs.destroy).to.be.called; + expect(stubs.setupUI).to.be.called; }); it('should get the error viewer, attach viewer listeners, and load the error viewer', () => {