From d0cc0a4034bfcaed8c0b98d51c23f1891345e488 Mon Sep 17 00:00:00 2001 From: Felix Wiedenbach Date: Fri, 15 Oct 2021 06:50:54 +0200 Subject: [PATCH] move notificationReceived --- modules/default/alert/alert.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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); - } } });