Skip to content

Commit

Permalink
fix: remove not required check
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-prontera committed Aug 22, 2023
1 parent e841551 commit 78f498e
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions modules/core/src/GVL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,41 +442,37 @@ export class GVL extends Cloneable<GVL> implements VendorList {

const cacheLang = lang.toUpperCase();

if (parsedLanguage !== this.lang_) {
this.lang_ = parsedLanguage;

this.lang_ = parsedLanguage;
if (GVL.LANGUAGE_CACHE.has(cacheLang)) {

if (GVL.LANGUAGE_CACHE.has(cacheLang)) {
const cached: Declarations = GVL.LANGUAGE_CACHE.get(cacheLang) as Declarations;

const cached: Declarations = GVL.LANGUAGE_CACHE.get(cacheLang) as Declarations;
for (const prop in cached) {

for (const prop in cached) {
if (cached.hasOwnProperty(prop)) {

if (cached.hasOwnProperty(prop)) {

this[prop] = cached[prop];

}
this[prop] = cached[prop];

}

} else {
}

// load Language specified
const url = GVL.baseUrl + GVL.languageFilename.replace('[LANG]', this.lang_.toLowerCase());
} else {

try {
// load Language specified
const url = GVL.baseUrl + GVL.languageFilename.replace('[LANG]', this.lang_.toLowerCase());

await this.fetchJson(url);
try {

this.cacheLang_ = cacheLang;
this.cacheLanguage();
await this.fetchJson(url);

} catch (err) {
this.cacheLang_ = cacheLang;
this.cacheLanguage();

throw new GVLError('unable to load language: ' + err.message);
} catch (err) {

}
throw new GVLError('unable to load language: ' + err.message);

}

Expand Down

0 comments on commit 78f498e

Please sign in to comment.