diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-08-27 13:19:12 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-08-27 13:19:12 +0200 |
commit | ceffbe9f6de99a467f1efbe66a8e1aef4ee4f5dd (patch) | |
tree | 38fd8a1fc6a6834c2b0d79e5396965105e05d136 /apps/weather_status/src | |
parent | df99d8f0e02c23b8b9fb43c72183eef5e49430ba (diff) | |
download | nextcloud-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.vue | 6 |
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() { |