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>
This commit is contained in:
parent
df99d8f0e0
commit
ceffbe9f6d
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()
|
this.startLoop()
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} 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.'))
|
showError(t('weather_status', 'There was an error getting the weather status information.'))
|
||||||
console.debug(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
startLoop() {
|
startLoop() {
|
||||||
|
|
Loading…
Reference in New Issue