Fix notifications.alert (async usage)

this broke the reboot button among other things
This commit is contained in:
Girish Ramakrishnan
2021-07-12 15:44:49 -07:00
parent cad7d4a78f
commit 14000e56b7
2 changed files with 21 additions and 31 deletions

View File

@@ -137,19 +137,18 @@ function setupAccount(req, res, next) {
});
}
function reboot(req, res, next) {
async function reboot(req, res, next) {
// Finish the request, to let the appstore know we triggered the reboot
next(new HttpSuccess(202, {}));
cloudron.reboot(function () {});
await safe(cloudron.reboot());
}
function isRebootRequired(req, res, next) {
cloudron.isRebootRequired(function (error, result) {
if (error) return next(BoxError.toHttpError(error));
async function isRebootRequired(req, res, next) {
const [error, rebootRequired] = await safe(cloudron.isRebootRequired());
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, { rebootRequired: result }));
});
next(new HttpSuccess(200, { rebootRequired }));
}
function getConfig(req, res, next) {