diff --git a/modules/default/alert/alert.js b/modules/default/alert/alert.js index 5fd22c12..0ed34fb0 100644 --- a/modules/default/alert/alert.js +++ b/modules/default/alert/alert.js @@ -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); @@ -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); - } } });