mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-20 03:36:41 +00:00
Correctly evaluate downloadProgress when computing current state
Change-type: patch Closes: #1918 Signed-off-by: 20k-ultra <3946250+20k-ultra@users.noreply.github.com>
This commit is contained in:
parent
fa9074ce76
commit
c1b5e58ebd
@ -1041,7 +1041,9 @@ export async function getState() {
|
||||
commit,
|
||||
serviceName,
|
||||
status: status as string,
|
||||
...(downloadProgress && { download_progress: downloadProgress }),
|
||||
...(Number.isInteger(downloadProgress) && {
|
||||
download_progress: downloadProgress,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
|
@ -1373,6 +1373,14 @@ describe('compose/application-manager', () => {
|
||||
serviceName: 'ubuntu',
|
||||
status: 'Downloaded',
|
||||
},
|
||||
{
|
||||
name: 'node:latest',
|
||||
commit: 'latestrelease',
|
||||
appUuid: 'myapp',
|
||||
serviceName: 'node',
|
||||
status: 'Downloading',
|
||||
downloadProgress: 0,
|
||||
},
|
||||
{
|
||||
name: 'alpine:latest',
|
||||
commit: 'latestrelease',
|
||||
@ -1427,6 +1435,11 @@ describe('compose/application-manager', () => {
|
||||
status: 'Downloading',
|
||||
download_progress: 50,
|
||||
},
|
||||
node: {
|
||||
image: 'node:latest',
|
||||
status: 'Downloading',
|
||||
download_progress: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user