Quote language feature and date settings

This commit is contained in:
David Ralph
2020-11-30 15:03:23 +00:00
parent 86b6ad6542
commit 7bfa7ed0a8
4 changed files with 31 additions and 2 deletions

View File

@@ -65,7 +65,7 @@ export default class Quote extends React.PureComponent {
if (localStorage.getItem('offlineMode') === 'true') return this.doOffline();
try { // First we try and get a quote from the API...
const data = await (await fetch(Constants.API_URL + '/getQuote')).json();
const data = await (await fetch(Constants.API_URL + '/getQuote?language=' + localStorage.getItem('quotelanguage'))).json();
if (data.statusCode === 429) return this.doOffline(); // If we hit the ratelimit, we fallback to local quotes
this.setState({
quote: '"' + data.quote + '"',