Check whether snippet preview is shown on page before hiding / showing errors. Fixes #1178