backups: fix restore code path after backup id changes

This commit is contained in:
Girish Ramakrishnan
2022-04-05 09:28:30 -07:00
parent b4b999bd74
commit 709d4041b2
7 changed files with 38 additions and 34 deletions
+2 -2
View File
@@ -328,7 +328,7 @@ async function install(app, args, progressCallback) {
}
await services.teardownAddons(app, addonsToRemove);
if (!restoreConfig || restoreConfig.backupId) { // in-place import should not delete data dir
if (!restoreConfig || restoreConfig.remotePath) { // in-place import should not delete data dir
await deleteAppDir(app, { removeDirectory: false }); // do not remove any symlinked appdata dir
}
@@ -357,7 +357,7 @@ async function install(app, args, progressCallback) {
if (!restoreConfig) { // install
await progressCallback({ percent: 60, message: 'Setting up addons' });
await services.setupAddons(app, app.manifest.addons);
} else if (app.installationState === apps.ISTATE_PENDING_IMPORT && !restoreConfig.backupId) { // in-place import
} else if (app.installationState === apps.ISTATE_PENDING_IMPORT && !restoreConfig.remotePath) { // in-place import
await progressCallback({ percent: 60, message: 'Importing addons in-place' });
await services.setupAddons(app, app.manifest.addons);
await services.clearAddons(app, _.omit(app.manifest.addons, 'localstorage'));