Skip to content

Commit

Permalink
fix(LoadingOverlay): fix for portal already loaded error
Browse files Browse the repository at this point in the history
When using the async pipe and a nested value the portal could be reinitialized without first tearing
down the portal

ISSUES CLOSED: #1455
  • Loading branch information
benjamincharity committed Apr 16, 2019
1 parent b69b1e2 commit f33f725
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion terminus-ui/loading-overlay/src/loading-overlay.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export class TsLoadingOverlayDirective implements OnInit, OnDestroy {
*/
@Input()
public set tsLoadingOverlay(value: boolean) {
const shouldSet = value;
const shouldSet = value && (this.bodyPortalHost && !this.bodyPortalHost.hasAttached());

if (shouldSet) {
this.bodyPortalHost.attach(this.loadingOverlayPortal);
} else {
Expand Down

0 comments on commit f33f725

Please sign in to comment.