Eslint fix
This commit is contained in:
parent
0de03537c4
commit
df4f99aab9
@ -1,6 +1,8 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';
|
||||
import { ComponentType } from '@angular/cdk/portal';
|
||||
import { mergeMap } from 'rxjs/operators';
|
||||
import { from } from 'rxjs';
|
||||
|
||||
export const largeDialogConfig: MatDialogConfig = {
|
||||
width: '90vw',
|
||||
@ -44,8 +46,8 @@ export abstract class DialogService<T extends string> {
|
||||
...(config.dialogConfig || {}),
|
||||
data,
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
ref.afterClosed().subscribe(async result => {
|
||||
|
||||
const fn = async result => {
|
||||
if (result && cb) {
|
||||
await cb(result);
|
||||
}
|
||||
@ -53,7 +55,12 @@ export abstract class DialogService<T extends string> {
|
||||
if (finallyCb) {
|
||||
await finallyCb(result);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ref.afterClosed()
|
||||
.pipe(mergeMap(result => from(fn(result))))
|
||||
.subscribe();
|
||||
|
||||
return ref;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user