Skip to content

Commit

Permalink
Destructure msg.data for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
dotNomad committed Nov 3, 2023
1 parent 5002c3f commit 431a073
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const logCb = $eventStream.addEventMonitorCallback('publish/restorePythonEnv/log
});
const statusCb = $eventStream.addEventMonitorCallback('publish/restorePythonEnv/status', (msg) => {
let newCaption: string;
switch (msg.data.status) {

const { status: packageStatus, name: packageName, version } = msg.data;
switch (packageStatus) {
case 'download+install':
newCaption = `Downloading and installing package: `;
break;
Expand All @@ -50,9 +52,9 @@ const statusCb = $eventStream.addEventMonitorCallback('publish/restorePythonEnv/
newCaption = `Installing package: `;
break;
}
newCaption += msg.data.name;
if (msg.data.version) {
newCaption += ` (${msg.data.version})`;
newCaption += packageName;
if (version) {
newCaption += ` (${version})`;
}
caption.value = newCaption;
});
Expand Down

0 comments on commit 431a073

Please sign in to comment.