diff --git a/src/components/widgets/Background.jsx b/src/components/widgets/Background.jsx index 531a1ba9..65d27220 100644 --- a/src/components/widgets/Background.jsx +++ b/src/components/widgets/Background.jsx @@ -70,6 +70,8 @@ export default class Background extends React.PureComponent { data = await fetch(requestURL); data = await data.json(); + if (data.statusCode === 429) return this.doOffline(); // If we hit the ratelimit, we fallback to local quotes + document.getElementById('backgroundImage').setAttribute( 'style', `-webkit-filter:blur(${localStorage.getItem('blur')}px); background-image: url(${data.file})` ); // Set background and blur etc diff --git a/src/components/widgets/Quote.jsx b/src/components/widgets/Quote.jsx index 3cfcd6fa..086d8227 100644 --- a/src/components/widgets/Quote.jsx +++ b/src/components/widgets/Quote.jsx @@ -36,7 +36,7 @@ export default class Quote extends React.PureComponent { try { // First we try and get a quote from the API... let data = await fetch(Constants.API_URL + '/getQuote'); data = await data.json(); - if (data.statusCode === 429) this.doOffline(); // If we hit the ratelimit, we fallback to local quotes + if (data.statusCode === 429) return this.doOffline(); // If we hit the ratelimit, we fallback to local quotes this.setState({ quote: '"' + data.quote + '"', author: data.author