notifications: rename alert to pin and unpin

This commit is contained in:
Girish Ramakrishnan
2024-12-11 15:47:41 +01:00
parent ead419003b
commit 746e694d7e
7 changed files with 112 additions and 71 deletions
+2
View File
@@ -25,6 +25,7 @@ const apps = require('./apps.js'),
eventlog = require('./eventlog.js'),
fs = require('fs'),
locks = require('./locks.js'),
notifications = require('./notifications.js'),
os = require('os'),
path = require('path'),
paths = require('./paths.js'),
@@ -236,6 +237,7 @@ async function notifyUpdate() {
await eventlog.add(eventlog.ACTION_INSTALL_FINISH, AuditSource.CRON, { version: constants.VERSION });
} else {
await eventlog.add(eventlog.ACTION_UPDATE_FINISH, AuditSource.CRON, { errorMessage: '', oldVersion: version || 'dev', newVersion: constants.VERSION });
await notifications.unpin(notifications.TYPE_BOX_UPDATE, { context: constants.VERSION });
const [error] = await safe(tasks.setCompletedByType(tasks.TASK_UPDATE, { error: null }));
if (error && error.reason !== BoxError.NOT_FOUND) throw error; // when hotfixing, task may not exist
}