loading progress NaN fix

This commit is contained in:
Drew Ansbacher
2021-12-01 17:18:48 -07:00
committed by Aiden McClelland
parent d38da2231e
commit c9d77e99af
10 changed files with 34 additions and 46 deletions

View File

@@ -646,38 +646,29 @@ export class MockApiService extends ApiService {
if (i === initialProgress.size) {
initialProgress[phase.completion] = true
}
let patch: any
if (initialProgress['unpack-complete']) {
patch = [
{
op: PatchOp.REMOVE,
path: `/package-data/${id}/install-progress`,
},
// {
// op: PatchOp.REMOVE,
// path: `/recovered-packages/${id}`,
// } as RemoveOperation,
]
} else {
patch = [
{
op: PatchOp.REPLACE,
path: `/package-data/${id}/install-progress`,
value: initialProgress,
},
]
}
const patch = [
{
op: PatchOp.REPLACE,
path: `/package-data/${id}/install-progress`,
value: initialProgress,
},
]
this.updateMock(patch)
}
}
setTimeout(() => {
const patch2 = [
const patch2: any = [
{
op: PatchOp.REPLACE,
path: `/package-data/${id}`,
value: Mock.LocalPkgs[id],
},
{
op: PatchOp.REMOVE,
path: `/package-data/${id}/install-progress`,
},
]
this.updateMock(patch2)
}, 1000)