Fixed infinite loop.
Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit
Some checks failed
farmcontrol/farmcontrol-ui/pipeline/head There was a failure building this commit
This commit is contained in:
parent
b1d86cad19
commit
f446bb22be
@ -41,7 +41,12 @@ const NotificationProvider = ({ children }) => {
|
|||||||
return data
|
return data
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
|
const is404 = err?.response?.status === 404
|
||||||
|
if (is404) {
|
||||||
|
setNotifications([])
|
||||||
|
} else {
|
||||||
showError(err, () => fetchNotifications())
|
showError(err, () => fetchNotifications())
|
||||||
|
}
|
||||||
return []
|
return []
|
||||||
} finally {
|
} finally {
|
||||||
setNotificationsLoading(false)
|
setNotificationsLoading(false)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user