Skip to content

Commit dee78cb

Browse files
committed
reject container promise if existing
1 parent 837947b commit dee78cb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/dialog/dialog-container.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ export class MdDialogContainer extends BasePortalHost implements AfterViewInit {
6161
// The @ViewChild query for the portalHost is not resolved until AfterViewInit, but this
6262
// function may be called before this lifecycle event. As such, we defer the attachment of
6363
// the portal until AfterViewInit.
64+
if (this._deferredAttachCompleter) {
65+
this._deferredAttachCompleter.reject();
66+
}
67+
6468
this._deferredAttachPortal = portal;
6569
this._deferredAttachCompleter = new PromiseCompleter();
6670
return this._deferredAttachCompleter.promise;

0 commit comments

Comments
 (0)