Skip to content

Commit

Permalink
fix: #8484 apply code rabbit suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-rocket committed Oct 25, 2024
1 parent b26eee3 commit 367e008
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ export class TimeTrackingAuthorizedDirective implements OnInit {
)
),
tap((hasPermission: boolean) => {
this._viewContainer.clear(); // Clear the container once per status change

if (hasPermission) {
this._viewContainer.clear(); // Clear the container once per status change
this._viewContainer.createEmbeddedView(this._templateRef);
} else {
this.showTemplateBlockInView(this.permissionElse);
Expand All @@ -82,10 +81,11 @@ export class TimeTrackingAuthorizedDirective implements OnInit {
* @returns
*/
showTemplateBlockInView(template: TemplateRef<any>) {
this._viewContainer.clear();
this._viewContainer.clear(); // Clear the container once per status change
if (!template) {
return;
}

this._viewContainer.createEmbeddedView(template);
this._cdr.markForCheck();
}
Expand Down

0 comments on commit 367e008

Please sign in to comment.