Avoid briefly-visible error message on navigate away