mirror of
https://github.com/ivabus/gui
synced 2025-04-23 14:07:14 +03:00
fix package loading logic (#536)
This commit is contained in:
parent
c021e6021e
commit
b7ddfa04fe
1 changed files with 5 additions and 5 deletions
|
@ -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") {
|
||||
|
|
Loading…
Reference in a new issue