Handle case ECU is not in message (#111)

This commit is contained in:
John Wu
2021-11-15 15:40:35 -08:00
committed by GitHub
parent 537e8ed30b
commit 410962fe97

View File

@@ -98,7 +98,7 @@ export const CarUpdatesProvider = ({ children }) => {
if (validateStatusMessage(status)) {
if (status.msg === "downloading") {
item.progress = getDownloadProgress(status);
item.status = `downloading ${item.ecu} ${item.progress}%`;
item.status = `${item.ecu || ""} downloading ${item.progress}%`.trim();
return;
} else if (status.msg === "package_download_complete") {
item.progress = 100;
@@ -106,7 +106,7 @@ export const CarUpdatesProvider = ({ children }) => {
return;
} else if (status.msg === "installing") {
item.progress = getInstallProgress(status);
item.status = `installing ${item.ecu} ${item.progress}%`;
item.status = `${item.ecu || ""} installing ${item.progress}%`.trim();
return;
} else if (status.msg === "package_install_complete") {
item.progress = 100;