summaryrefslogtreecommitdiffstats
path: root/apps/weather_status/src
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-08-27 13:19:12 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-08-27 13:19:12 +0200
commitceffbe9f6de99a467f1efbe66a8e1aef4ee4f5dd (patch)
tree38fd8a1fc6a6834c2b0d79e5396965105e05d136 /apps/weather_status/src
parentdf99d8f0e02c23b8b9fb43c72183eef5e49430ba (diff)
downloadnextcloud-server-ceffbe9f6de99a467f1efbe66a8e1aef4ee4f5dd.tar.gz
nextcloud-server-ceffbe9f6de99a467f1efbe66a8e1aef4ee4f5dd.zip
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 <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/weather_status/src')
-rw-r--r--apps/weather_status/src/App.vue6
1 files changed, 5 insertions, 1 deletions
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() {