mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-4022] Remove custom redirect strategy, the viewer doesn not reload (#1719)
* remove custom redirect strategy, the viewer doesn not reload * Update extensions-data-loader.guard.ts add return in case of no loaders * remove the route strategy * fix lint * Fix link error * Align unit test Co-authored-by: Maurizio Vitale <maurizio.vitale@alfresco.com> Co-authored-by: Andras Popovics <popovics@ndras.hu>
This commit is contained in:
@@ -23,11 +23,9 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Injectable, Inject } from '@angular/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AuthenticationService, AppConfigService } from '@alfresco/adf-core';
|
||||
import { Observable, BehaviorSubject } from 'rxjs';
|
||||
import { RouteReuseStrategy } from '@angular/router';
|
||||
import { AppRouteReuseStrategy } from '../routing/app.routes.strategy';
|
||||
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
|
||||
@Injectable({
|
||||
@@ -45,23 +43,16 @@ export class AppService {
|
||||
return this.config.get<boolean>('auth.withCredentials', false);
|
||||
}
|
||||
|
||||
constructor(
|
||||
auth: AuthenticationService,
|
||||
private config: AppConfigService,
|
||||
searchQueryBuilderService: SearchQueryBuilderService,
|
||||
@Inject(RouteReuseStrategy) routeStrategy: AppRouteReuseStrategy
|
||||
) {
|
||||
constructor(auth: AuthenticationService, private config: AppConfigService, searchQueryBuilderService: SearchQueryBuilderService) {
|
||||
this.ready = new BehaviorSubject(auth.isLoggedIn() || this.withCredentials);
|
||||
this.ready$ = this.ready.asObservable();
|
||||
|
||||
auth.onLogin.subscribe(() => {
|
||||
routeStrategy.resetCache();
|
||||
this.ready.next(true);
|
||||
});
|
||||
|
||||
auth.onLogout.subscribe(() => {
|
||||
searchQueryBuilderService.resetToDefaults();
|
||||
routeStrategy.resetCache();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user