Fix quotes controller (#2720)

* Fix quotes controller

* Additional fixes

* Fix
This commit is contained in:
Bruce Berrios 2022-03-16 22:27:48 -04:00 committed by GitHub
parent 0e1d151112
commit 2d2dc47881
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,9 @@ class QuotesController {
if (this.quoteCollection.language !== normalizedLanguage) {
try {
const data: QuoteData = await $.getJSON(`quotes/${language}.json`);
const data: QuoteData = await $.getJSON(
`quotes/${normalizedLanguage}.json`
);
if (data.quotes === undefined || data.quotes.length === 0) {
return defaultQuoteCollection;
@ -62,7 +64,7 @@ class QuotesController {
source: quote.source,
length: quote.length,
id: quote.id,
language: language,
language: data.language,
group: 0,
};