diff options
Diffstat (limited to 'client/src/app/core/routing/preload-selected-modules-list.ts')
-rw-r--r-- | client/src/app/core/routing/preload-selected-modules-list.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/app/core/routing/preload-selected-modules-list.ts b/client/src/app/core/routing/preload-selected-modules-list.ts index b5c3195b0..1abcdb015 100644 --- a/client/src/app/core/routing/preload-selected-modules-list.ts +++ b/client/src/app/core/routing/preload-selected-modules-list.ts | |||
@@ -1,13 +1,13 @@ | |||
1 | import { Observable, of as ofObservable, timer as observableTimer } from 'rxjs' | 1 | import { Observable, of as ofObservable, timer as observableTimer } from 'rxjs' |
2 | import { switchMap } from 'rxjs/operators' | 2 | import { switchMap } from 'rxjs/operators' |
3 | import { PreloadingStrategy, Route } from '@angular/router' | ||
4 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { PreloadingStrategy, Route } from '@angular/router' | ||
5 | 5 | ||
6 | @Injectable() | 6 | @Injectable() |
7 | export class PreloadSelectedModulesList implements PreloadingStrategy { | 7 | export class PreloadSelectedModulesList implements PreloadingStrategy { |
8 | 8 | ||
9 | preload (route: Route, load: () => Observable<any>): Observable<any> { | 9 | preload (route: Route, load: () => Observable<any>): Observable<any> { |
10 | if (!route.data || !route.data.preload) return ofObservable(null) | 10 | if (!route.data?.preload) return ofObservable(null) |
11 | 11 | ||
12 | if (typeof route.data.preload === 'number') { | 12 | if (typeof route.data.preload === 'number') { |
13 | return observableTimer(route.data.preload).pipe(switchMap(() => load())) | 13 | return observableTimer(route.data.preload).pipe(switchMap(() => load())) |