mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
fix issue where more than one api call was made on every route change
This commit is contained in:
@@ -32,6 +32,7 @@ import { logStartupMessage } from '../../../startup-message';
|
||||
import { MenuService } from '../../app/shared/menu/menu.service';
|
||||
import { RootDataService } from '../../app/core/data/root-data.service';
|
||||
import { firstValueFrom, Subscription } from 'rxjs';
|
||||
import { ServerCheckGuard } from '../../app/core/server-check/server-check.guard';
|
||||
|
||||
/**
|
||||
* Performs client-side initialization.
|
||||
@@ -56,7 +57,8 @@ export class BrowserInitService extends InitService {
|
||||
protected authService: AuthService,
|
||||
protected themeService: ThemeService,
|
||||
protected menuService: MenuService,
|
||||
private rootDataService: RootDataService
|
||||
private rootDataService: RootDataService,
|
||||
protected serverCheckGuard: ServerCheckGuard,
|
||||
) {
|
||||
super(
|
||||
store,
|
||||
@@ -172,4 +174,13 @@ export class BrowserInitService extends InitService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Start route-listening subscriptions
|
||||
* @protected
|
||||
*/
|
||||
protected initRouteListeners(): void {
|
||||
super.initRouteListeners();
|
||||
this.serverCheckGuard.listenForRouteChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user