Rapid changing of templates leads to infinite loading of preview
[Provide a general summary of the issue in the title above]
Expected behavior
We need to account for a user changing templates rapidly before the preview loads.
Current behavior
If a user changes templates rapidly and repeatedly the preview shows a loading animation but the preview doesn't load until the screen is refreshed.
Steps to reproduce
[Provide a link to a live example or screenshots, and the steps to reproduce this bug]
- Go to https://ketida.cokodemo.net/
- Create a book and a chapter in it
- Go to Preview & Export
- Change templates multiple times, before the preview loads keep changing your template selection
- Notice that you get a loading animation but the preview doesn't load until the screen is refreshed.
Environment
Firefox
Possible solution
Either reload the page to get the preview back in this rare case, or don't let the user change settings until the page is loaded (but that might be frustrating so isn't ideal),