Skip to content

Commit

Permalink
translation loading timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
x87 committed Dec 3, 2022
1 parent a281014 commit 2fba1c8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion editor/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,16 @@ import { LibraryPageComponent } from './components/library-page/library-page.com
import { KNOWN_LANGUAGES } from './models';
import { DecisionTreeComponent } from './components/decision-tree/decision-tree.component';
import { ServiceWorkerModule } from '@angular/service-worker';
import { timeout } from 'rxjs/operators';

class CustomTranslateLoader extends TranslateHttpLoader {
getTranslation(lang: string) {
return super.getTranslation(lang).pipe(timeout(3000));
}
}

export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
return new CustomTranslateLoader(http);
}

export function loadTranslations(
Expand Down

0 comments on commit 2fba1c8

Please sign in to comment.