From ceffbe9f6de99a467f1efbe66a8e1aef4ee4f5dd Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 27 Aug 2020 13:19:12 +0200 Subject: Hide error if a background request fails during navigation If you open the dashboard but quickly navigate somewhere else, a toast will show telling you that the weather status could not be fetched. As a user I don't care about this. This is only relevant if the user intents to no leave the page. So let's not show a toast for aborted connections. This makes the UX a tad smoother. Signed-off-by: Christoph Wurst --- apps/weather_status/src/App.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apps/weather_status/src') diff --git a/apps/weather_status/src/App.vue b/apps/weather_status/src/App.vue index aed774cb98d..6aaef4aaf6d 100644 --- a/apps/weather_status/src/App.vue +++ b/apps/weather_status/src/App.vue @@ -236,8 +236,12 @@ export default { this.startLoop() } } catch (err) { + if (err?.code === 'ECONNABORTED') { + console.info('The weather status request was cancelled because the user navigates.') + return + } showError(t('weather_status', 'There was an error getting the weather status information.')) - console.debug(err) + console.error(err) } }, startLoop() { -- cgit v1.2.3