48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
|
import { Injectable } from '@angular/core';
|
||
|
|
||
|
import { tap } from 'rxjs/operators';
|
||
|
|
||
|
import { Actions, createEffect, ofType } from '@ngrx/effects';
|
||
|
import { Store } from '@ngrx/store';
|
||
|
|
||
|
import { NGXLogger } from 'ngx-logger';
|
||
|
|
||
|
import { DialogService } from '@ucap-webmessenger/ui';
|
||
|
|
||
|
import { showDialog } from './actions';
|
||
|
import {
|
||
|
MessengerSettingsDialogComponent,
|
||
|
MessengerSettingsDialogData,
|
||
|
MessengerSettingsDialogResult
|
||
|
} from '@app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component';
|
||
|
|
||
|
@Injectable()
|
||
|
export class Effects {
|
||
|
showDialog$ = createEffect(
|
||
|
() =>
|
||
|
this.actions$.pipe(
|
||
|
ofType(showDialog),
|
||
|
tap(async () => {
|
||
|
const result = await this.dialogService.open<
|
||
|
MessengerSettingsDialogComponent,
|
||
|
MessengerSettingsDialogData,
|
||
|
MessengerSettingsDialogResult
|
||
|
>(MessengerSettingsDialogComponent, {
|
||
|
width: '800px',
|
||
|
height: '800px',
|
||
|
disableClose: false,
|
||
|
data: {}
|
||
|
});
|
||
|
})
|
||
|
),
|
||
|
{ dispatch: false }
|
||
|
);
|
||
|
|
||
|
constructor(
|
||
|
private actions$: Actions,
|
||
|
private store: Store<any>,
|
||
|
private dialogService: DialogService,
|
||
|
private logger: NGXLogger
|
||
|
) {}
|
||
|
}
|