diff --git a/src/apps.js b/src/apps.js index da4d054e1..9b34f7863 100644 --- a/src/apps.js +++ b/src/apps.js @@ -2853,7 +2853,7 @@ async function restoreApps(apps, options, auditSource) { const [error, result] = await safe(backups.getByIdentifierAndStatePaged(app.id, backups.BACKUP_STATE_NORMAL, 1, 1)); let installationState, restoreConfig; if (!error && result.length) { - installationState = exports.ISTATE_PENDING_IMPORT; + installationState = exports.ISTATE_PENDING_RESTORE; restoreConfig = { remotePath: result[0].remotePath, backupTarget: options.backupTarget }; } else { installationState = exports.ISTATE_PENDING_INSTALL; diff --git a/src/apptask.js b/src/apptask.js index 207977060..3cb74abbc 100644 --- a/src/apptask.js +++ b/src/apptask.js @@ -265,7 +265,7 @@ async function installCommand(app, args, progressCallback) { assert.strictEqual(typeof args, 'object'); assert.strictEqual(typeof progressCallback, 'function'); - // restoreConfig is one of { backupId } (restore), { remotePath, backupTarget } (import) or { inPlace } (import) + // restoreConfig is one of null (install) OR { backupId } (restore) OR { remotePath, backupTarget } (import) OR { inPlace } (import) const { restoreConfig, overwriteDns, skipDnsSetup, oldManifest } = args; // this protects against the theoretical possibility of an app being marked for install/restore from @@ -324,7 +324,7 @@ async function installCommand(app, args, progressCallback) { await services.clearAddons(app, _.omit(app.manifest.addons, ['localstorage'])); await apps.loadConfig(app); await services.restoreAddons(app, app.manifest.addons); - } else if (app.installationState === apps.ISTATE_PENDING_IMPORT && restoreConfig.remotePath) { // import + } else if ((app.installationState === apps.ISTATE_PENDING_IMPORT || app.installationState === apps.ISTATE_PENDING_RESTORE) && restoreConfig.remotePath) { // app import or app restore during full box restore await progressCallback({ percent: 65, message: 'Downloading backup and restoring addons' }); await services.setupAddons(app, app.manifest.addons); await services.clearAddons(app, app.manifest.addons);