clone: read custom icon from downloaded backup

the backups table does not have icon to save space. only the
archives table has it for the moment.
This commit is contained in:
Girish Ramakrishnan
2024-12-10 22:43:06 +01:00
parent 05d6484d27
commit 65f507bc75
2 changed files with 5 additions and 4 deletions

View File

@@ -366,6 +366,10 @@ async function install(app, args, progressCallback) {
await services.setupAddons(app, app.manifest.addons);
await services.clearAddons(app, app.manifest.addons);
await backuptask.downloadApp(app, restoreConfig, (progress) => { progressCallback({ percent: 65, message: progress.message }); });
if (app.installationState === apps.ISTATE_PENDING_CLONE) {
const customIcon = safe.fs.readFileSync(path.join(paths.APPS_DATA_DIR, app.id + '/icon.png'));
if (customIcon) await updateApp(app, { icon: customIcon });
}
await progressCallback({ percent: 70, message: 'Restoring addons' });
await services.restoreAddons(app, app.manifest.addons);
}