Viewers
Viewers copied to clipboard
Current viewport is not being set as active after changing Layout selection back to one viewport
Bug Report
Description
If user changes the viewport selection to more than one viewport and interacts with those viewports, once he/she switches back to only 1 viewport, the current viewport is not being set as active. This is causing the application to throw an exception when the user selects another tool at the toolbar menu.

Steps to reproduce
- Load view studies page
- Select the Layout tool on the toolbar
- Change the layout selection to 3 (or more)
- Click on any viewport different from the 1st one
- Change the layout selection back to 1
- Click on Reset tool on the toolbar
- Check that exception
element not enabledwas thrown
Actual result
Exception element not enabled is being thrown and user is not able to use the selected tool
Acceptance criteria
After changing the viewport number selection and returning back to only 1 viewport, the current viewport should be set as active by default.
👋 Take it away, @igoroctaviano
Resolved here: https://github.com/OHIF/Viewers/pull/1018