Skip to content

Commit

Permalink
HELLODATA-1887 - refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Slawomir Wieczorek committed Feb 7, 2025
1 parent a4edab7 commit abb9356
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {naviElements} from "../../app-navi-elements";
import {createBreadcrumbs} from "../../store/breadcrumb/breadcrumb.action";
import {interval, Observable, Subject, takeUntil, tap} from "rxjs";
import {selectSelectedLanguage} from "../../store/auth/auth.selector";
import {renewCloudbeaverSession} from "../../store/auth/auth.action";
import {prolongCBSession} from "../../store/auth/auth.action";

@Component({
templateUrl: 'embedded-dm-viewer.component.html',
Expand Down Expand Up @@ -92,7 +92,7 @@ export class EmbeddedDmViewerComponent implements OnDestroy {
this.renewSessionInterval$
.pipe(takeUntil(this.destroy$))
.subscribe(() => {
this.store.dispatch(renewCloudbeaverSession());
this.store.dispatch(prolongCBSession());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {naviElements} from "../../app-navi-elements";
import {createBreadcrumbs} from "../../store/breadcrumb/breadcrumb.action";
import {BaseComponent} from "../../shared/components/base/base.component";
import {interval, Subject, takeUntil} from "rxjs";
import {renewCloudbeaverSession} from "../../store/auth/auth.action";
import {prolongCBSession} from "../../store/auth/auth.action";

@Component({
templateUrl: 'data-warehouse-viewer.component.html',
Expand Down Expand Up @@ -74,7 +74,7 @@ export class DataWarehouseViewerComponent extends BaseComponent implements OnDes
this.renewSessionInterval$
.pipe(takeUntil(this.destroy$))
.subscribe(() => {
this.store.dispatch(renewCloudbeaverSession());
this.store.dispatch(prolongCBSession());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ export enum AuthActionType {
SET_SELECTED_LANGUAGE = '[AUTH] Set selected language',
SET_DEFAULT_LANGUAGE = '[AUTH] Set default language',
SET_AVAILABLE_LANGUAGES = '[AUTH] Set available languages',
SET_AVAILABLE_LANGUAGES_SUCCESS = '[AUTH] Set available languages success',
SET_ACTIVE_TRANSLOCO_LANGUAGE = '[AUTH] Set active transloco language',
RENEW_CLOUDBEAVER_SESSION = '[AUTH] Renew cloudbeaver session',
PROLONG_CB_SESSION = '[AUTH] Prolong the Cloudbeaver session',
}

export const login = createAction(
Expand Down Expand Up @@ -111,6 +110,6 @@ export const setAvailableLanguages = createAction(
props<{ langs: string[] }>()
);

export const renewCloudbeaverSession = createAction(
AuthActionType.RENEW_CLOUDBEAVER_SESSION
export const prolongCBSession = createAction(
AuthActionType.PROLONG_CB_SESSION
);
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
login,
loginComplete,
logout,
renewCloudbeaverSession,
prolongCBSession,
setActiveTranslocoLanguage,
setAvailableLanguages,
setDefaultLanguage,
Expand Down Expand Up @@ -226,12 +226,10 @@ export class AuthEffects {
)
});

renewCloudbdaverSession$ = createEffect(() => {
prolongCloudBeaverSession$ = createEffect(() => {
return this._actions$.pipe(
ofType(renewCloudbeaverSession),
switchMap(() => {
return this._cloudbeaverService.renewSession();
}),
ofType(prolongCBSession),
switchMap(() => this._cloudbeaverService.renewSession()),
catchError(e => of(showError({error: e})))
)
});
Expand Down

0 comments on commit abb9356

Please sign in to comment.