mirror of
https://github.com/ivabus/gui
synced 2025-06-08 00:00:27 +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;
|
const pkgs = JSON.parse(pkgData.toString()) as Packages;
|
||||||
|
|
||||||
if (pkgs?.packages) {
|
if (pkgs?.packages) {
|
||||||
pkgs.packages = pkgs.packages.map((pkg: GUIPackage) => {
|
// Remove any temporary properties that may have been added to the package (like installation progress)
|
||||||
const { install_progress_percentage, isUninstalling, synced, ...rest } = pkg;
|
for (const [key, value] of Object.entries(pkgs.packages)) {
|
||||||
return rest;
|
const { install_progress_percentage, isUninstalling, synced, ...rest } = value;
|
||||||
});
|
pkgs.packages[key] = rest;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return pkgs;
|
return pkgs;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code !== "ENOENT") {
|
if (err.code !== "ENOENT") {
|
||||||
|
|
Loading…
Reference in a new issue