Skip to content

Commit

Permalink
fix(site-header): Fixing removal of the notification containers - FRO…
Browse files Browse the repository at this point in the history
…NT-4637

!
  • Loading branch information
planctus committed Oct 1, 2024
1 parent 0cea15c commit eb35bcf
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export class SiteHeader {
this.loginBox = null;
this.resizeTimer = null;
this.direction = null;
this.notificationContainer = null;

// Bind `this` for use in callbacks
this.openOverlay = this.openOverlay.bind(this);
Expand Down Expand Up @@ -192,6 +193,10 @@ export class SiteHeader {
ECL.components.set(this.element, this);

if (this.notification) {
this.notificationContainer = this.notification.closest(
'.ecl-site-header__notification',
);

setTimeout(() => {
const eclNotification = ECL.components.get(this.notification);

Expand Down Expand Up @@ -418,11 +423,8 @@ export class SiteHeader {
* Removes the containers of the notification element
*/
handleNotificationClose() {
const notificationContainer = this.notification.closest(
'ecl-site-header__notification',
);
if (notificationContainer) {
notificationContainer.remove();
if (this.notificationContainer) {
this.notificationContainer.remove();
}
}

Expand Down

0 comments on commit eb35bcf

Please sign in to comment.