Skip to content

Commit

Permalink
fix(i18n): nullObject is {}
Browse files Browse the repository at this point in the history
  • Loading branch information
devcui committed Aug 24, 2023
1 parent e1c54e2 commit 2202e26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/bis/layout/yunzai-i18n.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class YunzaiI18NService extends YunzaiI18nBaseService implements OnDestro
if (ngDevMode) {
return this.http.get(`assets/tmp/i18n/${lang}.json`);
} else {
if (this.getLang(lang) !== {}) {
if (this.getLang(lang) !== null) {
return of(this.getLang(lang));
}
return this.http
Expand Down Expand Up @@ -126,9 +126,9 @@ export class YunzaiI18NService extends YunzaiI18nBaseService implements OnDestro
setLang(lang, data);
}

getLang(lang: string): Record<string, unknown> {
getLang(lang: string): Record<string, unknown> | null {
const [, getL] = useLocalStorageLang();
return getL(lang) || {};
return getL(lang) || null;
}

cacheLangs(langs: YunzaiI18NType[]): void {
Expand Down

0 comments on commit 2202e26

Please sign in to comment.