mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-02 09:17:57 +00:00
Merge pull request #1920 from balena-os/eval-download-progress-correctly
Correctly evaluate downloadProgress when computing current state
This commit is contained in:
commit
c5f40b4c83
@ -1041,7 +1041,9 @@ export async function getState() {
|
|||||||
commit,
|
commit,
|
||||||
serviceName,
|
serviceName,
|
||||||
status: status as string,
|
status: status as string,
|
||||||
...(downloadProgress && { download_progress: downloadProgress }),
|
...(Number.isInteger(downloadProgress) && {
|
||||||
|
download_progress: downloadProgress,
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1373,6 +1373,14 @@ describe('compose/application-manager', () => {
|
|||||||
serviceName: 'ubuntu',
|
serviceName: 'ubuntu',
|
||||||
status: 'Downloaded',
|
status: 'Downloaded',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'node:latest',
|
||||||
|
commit: 'latestrelease',
|
||||||
|
appUuid: 'myapp',
|
||||||
|
serviceName: 'node',
|
||||||
|
status: 'Downloading',
|
||||||
|
downloadProgress: 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'alpine:latest',
|
name: 'alpine:latest',
|
||||||
commit: 'latestrelease',
|
commit: 'latestrelease',
|
||||||
@ -1427,6 +1435,11 @@ describe('compose/application-manager', () => {
|
|||||||
status: 'Downloading',
|
status: 'Downloading',
|
||||||
download_progress: 50,
|
download_progress: 50,
|
||||||
},
|
},
|
||||||
|
node: {
|
||||||
|
image: 'node:latest',
|
||||||
|
status: 'Downloading',
|
||||||
|
download_progress: 0,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user