2019-11-21 10:29:19 +09:00
|
|
|
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',
|
2019-11-21 14:52:09 +09:00
|
|
|
maxWidth: '800px',
|
2019-11-21 10:29:19 +09:00
|
|
|
height: '800px',
|
2019-11-21 14:52:09 +09:00
|
|
|
minHeight: '800px',
|
2019-11-21 10:29:19 +09:00
|
|
|
disableClose: false,
|
|
|
|
data: {}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
),
|
|
|
|
{ dispatch: false }
|
|
|
|
);
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
private actions$: Actions,
|
|
|
|
private store: Store<any>,
|
|
|
|
private dialogService: DialogService,
|
|
|
|
private logger: NGXLogger
|
|
|
|
) {}
|
|
|
|
}
|