mirror of
https://github.com/mue/mue.git
synced 2026-07-13 12:07:45 +02:00
fix ratelimit returning undefined
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user