Fixes All Popups Signals

This commit is contained in:
2023-10-23 04:01:34 -03:00
parent 57d228c726
commit 0f4336c994

View File

@@ -104,6 +104,7 @@ export class HeaderComponent implements OnInit, OnDestroy {
public closeDropdown(): void { public closeDropdown(): void {
this.profileDropdownState = false; this.profileDropdownState = false;
} }
public loginPopupStateChange(state: boolean): void { public loginPopupStateChange(state: boolean): void {
if (state) { if (state) {
this.createLoginPopup(); this.createLoginPopup();
@@ -186,6 +187,12 @@ export class HeaderComponent implements OnInit, OnDestroy {
this.myProfileComponent.instance.state = true; this.myProfileComponent.instance.state = true;
this.myProfileComponent.instance.user = this.loggedUser; this.myProfileComponent.instance.user = this.loggedUser;
this.myProfileComponent.instance.ignoreClickOutside = [
this.profileBtnElementRef,
this.profileDropdownElementRef,
this.userElementRef,
].map((element) => element.nativeElement);
this.myProfileComponent.instance.stateChange.subscribe((state) => { this.myProfileComponent.instance.stateChange.subscribe((state) => {
if (!state) { if (!state) {
this.closeMyProfilePopup(); this.closeMyProfilePopup();
@@ -202,6 +209,12 @@ export class HeaderComponent implements OnInit, OnDestroy {
this.viewContainerRef.createComponent(HelpComponent); this.viewContainerRef.createComponent(HelpComponent);
this.helpComponent.instance.state = true; this.helpComponent.instance.state = true;
this.helpComponent.instance.ignoreClickOutside = [
this.profileBtnElementRef,
this.profileDropdownElementRef,
this.userElementRef,
].map((element) => element.nativeElement);
this.helpComponent.instance.stateChange.subscribe((state) => { this.helpComponent.instance.stateChange.subscribe((state) => {
if (!state) { if (!state) {
this.closeHelpPopup(); this.closeHelpPopup();