RED-3800: check for null
This commit is contained in:
parent
d02dadc56a
commit
75356e2328
@ -1,10 +1,10 @@
|
||||
import { AfterViewInit, Directive, HostListener, inject, OnDestroy, OnInit } from '@angular/core';
|
||||
import { AfterViewInit, Directive, HostListener, inject, OnDestroy } from '@angular/core';
|
||||
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { hasFormChanged, IqserEventTarget } from '../utils';
|
||||
import { ConfirmOptions } from '.';
|
||||
import { ConfirmationDialogService } from './confirmation-dialog.service';
|
||||
import { debounceTime, firstValueFrom, fromEvent, merge, Subscription } from 'rxjs';
|
||||
import { debounceTime, firstValueFrom, fromEvent, merge, of, Subscription } from 'rxjs';
|
||||
import { LoadingService } from '../loading';
|
||||
import { Toaster } from '../services';
|
||||
import { IconButtonTypes } from '../buttons';
|
||||
@ -46,8 +46,8 @@ export abstract class BaseDialogComponent implements AfterViewInit, OnDestroy {
|
||||
|
||||
ngAfterViewInit() {
|
||||
this._subscriptions.add(this._dialogRef.backdropClick().subscribe(() => this.close()));
|
||||
|
||||
const events = [fromEvent(window, 'keyup'), fromEvent(window, 'input'), this.form?.valueChanges];
|
||||
const valueChanges = this.form?.valueChanges ?? of(null);
|
||||
const events = [fromEvent(window, 'keyup'), fromEvent(window, 'input'), valueChanges];
|
||||
const events$ = merge(...events).pipe(
|
||||
debounceTime(10),
|
||||
tap(() => (this.#hasErrors = !!document.getElementsByClassName('ng-invalid')[0])),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user