move notificationReceived

This commit is contained in:
Felix Wiedenbach 2021-10-15 06:50:54 +02:00
parent f9c4a3a9c0
commit d0cc0a4034

View File

@ -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) { async showNotification(notification) {
const message = await this.renderMessage("notification", notification); const message = await this.renderMessage("notification", notification);
@ -130,17 +142,5 @@ Module.register("alert", {
for (const module of modules) { for (const module of modules) {
module.classList[method]("alert-blur"); 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);
}
} }
}); });