notifications: clearAlert

This commit is contained in:
Girish Ramakrishnan
2023-03-26 14:18:37 +02:00
parent 0ab73d6c5e
commit 61ba3cbfc2
3 changed files with 28 additions and 19 deletions

View File

@@ -168,7 +168,7 @@ async function getConfig() {
}
async function reboot() {
await notifications.alert(notifications.ALERT_REBOOT, 'Reboot Required', '');
await notifications.clearAlert(notifications.ALERT_REBOOT, 'Reboot Required');
const [error] = await safe(shell.promises.sudo('reboot', [ REBOOT_CMD ], {}));
if (error) debug('reboot: could not reboot', error);
@@ -198,7 +198,11 @@ async function checkMailStatus() {
async function checkRebootRequired() {
const rebootRequired = await isRebootRequired();
await notifications.alert(notifications.ALERT_REBOOT, 'Reboot Required', rebootRequired ? 'To finish ubuntu security updates, a reboot is necessary.' : '');
if (rebootRequired) {
await notifications.alert(notifications.ALERT_REBOOT, 'Reboot Required', 'To finish ubuntu security updates, a reboot is necessary.');
} else {
await notifications.clearAlert(notifications.ALERT_REBOOT, 'Reboot Required');
}
}
async function checkUbuntuVersion() {