Skip to content

Commit

Permalink
move notificationReceived
Browse files Browse the repository at this point in the history
  • Loading branch information
fewieden committed Oct 15, 2021
1 parent f9c4a3a commit d0cc0a4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions modules/default/alert/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ Module.register("alert", {
}
},

notificationReceived(notification, payload, sender) {
if (notification === "SHOW_ALERT") {
if (payload.type === "notification") {
this.showNotification(payload);
} else {
this.showAlert(payload, sender);
}
} else if (notification === "HIDE_ALERT") {
this.hideAlert(sender);
}
},

async showNotification(notification) {
const message = await this.renderMessage("notification", notification);

Expand Down Expand Up @@ -130,17 +142,5 @@ Module.register("alert", {
for (const module of modules) {
module.classList[method]("alert-blur");
}
},

notificationReceived(notification, payload, sender) {
if (notification === "SHOW_ALERT") {
if (payload.type === "notification") {
this.showNotification(payload);
} else {
this.showAlert(payload, sender);
}
} else if (notification === "HIDE_ALERT") {
this.hideAlert(sender);
}
}
});

0 comments on commit d0cc0a4

Please sign in to comment.