From c8e5632cd4285c97b4ae8af2b68fb02ab47d0a4a Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sun, 10 Feb 2019 12:58:37 +0100 Subject: [PATCH] feat(pomodoro): allow to hide dialog #144 --- .../dialog-pomodoro-break.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/features/pomodoro/dialog-pomodoro-break/dialog-pomodoro-break.component.ts b/src/app/features/pomodoro/dialog-pomodoro-break/dialog-pomodoro-break.component.ts index 60bb657243..c78088e3b3 100644 --- a/src/app/features/pomodoro/dialog-pomodoro-break/dialog-pomodoro-break.component.ts +++ b/src/app/features/pomodoro/dialog-pomodoro-break/dialog-pomodoro-break.component.ts @@ -18,25 +18,25 @@ export class DialogPomodoroBreakComponent { isBreakDone$ = this.pomodoroService.isManualPause$; currentCycle$ = this.pomodoroService.currentCycle$; - private isCloseDialog$: Observable = this.pomodoroService.isBreak$.pipe( + private _subs = new Subscription(); + private _isCloseDialog$: Observable = this.pomodoroService.isBreak$.pipe( withLatestFrom(this.pomodoroService.cfg$), filter(([isBreak, cfg]) => !cfg.isManualContinue && !isBreak), mapTo(true), ); - private _subs = new Subscription(); constructor( private _matDialogRef: MatDialogRef, public pomodoroService: PomodoroService, ) { - _matDialogRef.disableClose = true; + // _matDialogRef.disableClose = true; this._subs.add(this.pomodoroService.isBreak$.subscribe((isBreak) => { if (!isBreak) { this.isStopCurrentTime$.next(true); } })); - this._subs.add(this.isCloseDialog$.subscribe(() => { + this._subs.add(this._isCloseDialog$.subscribe(() => { this.close(); })); }