Skip to content

Commit

Permalink
fix: instanceof Observable always fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhenggang Su authored and fengtianze committed Aug 22, 2024
1 parent e9eca03 commit 46eaea0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/popular-bees-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alauda/ui": patch
---

instanceof observable always fail
4 changes: 2 additions & 2 deletions src/dialog/confirm-dialog/confirm-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Component,
ViewEncapsulation,
} from '@angular/core';
import { firstValueFrom, Observable } from 'rxjs';
import { firstValueFrom, isObservable } from 'rxjs';

import { ButtonComponent } from '../../button/button.component';
import { IconComponent } from '../../icon/icon.component';
Expand Down Expand Up @@ -113,7 +113,7 @@ export class ConfirmDialogComponent<T = unknown, R = unknown> {

const result = (beforeAction as CustomBeforeAction<T>)();

if (result instanceof Observable) {
if (isObservable(result)) {
return firstValueFrom(result);
}

Expand Down

0 comments on commit 46eaea0

Please sign in to comment.