remove unused logout action (#3987)

This commit is contained in:
Denys Vuika
2024-07-31 11:01:30 -04:00
committed by GitHub
parent 042269f325
commit 931739f17a
3 changed files with 2 additions and 28 deletions

View File

@@ -25,14 +25,12 @@
import { Actions, ofType, createEffect } from '@ngrx/effects';
import { Injectable } from '@angular/core';
import { map } from 'rxjs/operators';
import { AppActionTypes, LogoutAction, ReloadDocumentListAction, ResetSelectionAction } from '@alfresco/aca-shared/store';
import { AuthenticationService } from '@alfresco/adf-core';
import { Router } from '@angular/router';
import { AppActionTypes, ReloadDocumentListAction, ResetSelectionAction } from '@alfresco/aca-shared/store';
import { AppHookService } from '@alfresco/aca-shared';
@Injectable()
export class AppEffects {
constructor(private actions$: Actions, private auth: AuthenticationService, private router: Router, private appHookService: AppHookService) {}
constructor(private actions$: Actions, private appHookService: AppHookService) {}
reload = createEffect(
() =>
@@ -55,22 +53,4 @@ export class AppEffects {
),
{ dispatch: false }
);
logout$ = createEffect(
() =>
this.actions$.pipe(
ofType<LogoutAction>(AppActionTypes.Logout),
map(() => {
this.auth.logout().subscribe(
() => this.redirectToLogin(),
() => this.redirectToLogin()
);
})
),
{ dispatch: false }
);
private redirectToLogin(): Promise<boolean> {
return this.router.navigate(['login']);
}
}

View File

@@ -29,12 +29,10 @@ export enum AppActionTypes {
SetUserProfile = 'SET_USER_PROFILE',
SetRepositoryInfo = 'SET_REPOSITORY_INFO',
ToggleInfoDrawer = 'TOGGLE_INFO_DRAWER',
Logout = 'LOGOUT',
ReloadDocumentList = 'RELOAD_DOCUMENT_LIST',
ResetSelection = 'RESET_SELECTION',
SetInfoDrawerState = 'SET_INFO_DRAWER_STATE',
SetInfoDrawerMetadataAspect = 'SET_INFO_DRAWER_METADATA_ASPECT',
CloseModalDialogs = 'CLOSE_MODAL_DIALOGS',
SetFileUploadingDialog = 'SET_FILE_UPLOADING_DIALOG',
ShowInfoDrawerPreview = 'SHOW_INFO_DRAWER_PREVIEW',
SetInfoDrawerPreviewState = 'SET_INFO_DRAWER_PREVIEW_STATE',

View File

@@ -55,10 +55,6 @@ export class ToggleInfoDrawerAction implements Action {
readonly type = AppActionTypes.ToggleInfoDrawer;
}
export class LogoutAction implements Action {
readonly type = AppActionTypes.Logout;
}
export class ReloadDocumentListAction implements Action {
readonly type = AppActionTypes.ReloadDocumentList;