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>
pull/22458/head
Christoph Wurst 4 years ago
parent df99d8f0e0
commit ceffbe9f6d
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -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() {

Loading…
Cancel
Save