fix package loading logic (#536)

This commit is contained in:
ABevier 2023-05-01 13:43:36 -04:00 committed by GitHub
parent c021e6021e
commit b7ddfa04fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,12 +31,12 @@ export async function loadPackageCache(): Promise<Packages> {
const pkgs = JSON.parse(pkgData.toString()) as Packages;
if (pkgs?.packages) {
pkgs.packages = pkgs.packages.map((pkg: GUIPackage) => {
const { install_progress_percentage, isUninstalling, synced, ...rest } = pkg;
return rest;
});
// Remove any temporary properties that may have been added to the package (like installation progress)
for (const [key, value] of Object.entries(pkgs.packages)) {
const { install_progress_percentage, isUninstalling, synced, ...rest } = value;
pkgs.packages[key] = rest;
}
}
return pkgs;
} catch (err) {
if (err.code !== "ENOENT") {