Refactor book service in BE and FE (#2013)
* Refactor book service in BE and FE * Add missing method --------- Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import {inject, Injectable} from '@angular/core';
|
||||
import {IconService} from '../../shared/services/icon.service';
|
||||
import {forkJoin, Observable, of} from 'rxjs';
|
||||
import {catchError, map} from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PostLoginInitializerService {
|
||||
|
||||
private iconService = inject(IconService);
|
||||
|
||||
initialize(): Observable<void> {
|
||||
return forkJoin([
|
||||
this.preloadIcons(),
|
||||
]).pipe(
|
||||
map(() => undefined)
|
||||
);
|
||||
}
|
||||
|
||||
private preloadIcons(): Observable<void> {
|
||||
return this.iconService.preloadAllIcons().pipe(
|
||||
catchError((err) => {
|
||||
console.error('Failed to preload icons:', err);
|
||||
return of(void 0);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user