notifications: clear email status when message is empty

This commit is contained in:
Girish Ramakrishnan
2023-04-04 11:21:04 +02:00
parent ca2ebac694
commit f40c4b9b2c
3 changed files with 8 additions and 3 deletions

View File

@@ -192,8 +192,12 @@ async function runSystemChecks() {
}
async function checkMailStatus() {
const message = await mail.checkConfiguration();
await notifications.alert(notifications.ALERT_MAIL_STATUS, 'Email is not configured properly', message, { persist: true });
const result = await mail.checkConfiguration();
if (result.status) {
await notifications.clearAlert(notifications.ALERT_REBOOT, 'Email is not configured properly');
} else {
await notifications.alert(notifications.ALERT_MAIL_STATUS, 'Email is not configured properly', result.message, { persist: true });
}
}
async function checkRebootRequired() {