Skip to content

Commit

Permalink
Merge pull request #1179 from posit-dev/sagerb-limit-progress-bar
Browse files Browse the repository at this point in the history
Switch deployment progress bar from discrete progress to general progress
  • Loading branch information
sagerb authored Mar 20, 2024
2 parents beb6979 + f4ba1ca commit b4bd589
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions extensions/vscode/src/views/deployProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ export function deployProject(localID: string, stream: EventStream) {
registrations.push(
stream.register('publish/start', (msg: EventStreamMessage) => {
if (localID === msg.data.localId) {
progress.report({ increment: 0 });
progress.report({ message: "Starting to Deploy..." });
}
})
);

let progressCount = 0;
const handleProgressMessages = (msg: EventStreamMessage) => {
if (localID === msg.data.localId) {
const progressStr = eventTypeToString(msg.type);
progress.report({
increment: progressCount++,
message: progressStr,
});
console.log(progressStr);
Expand Down Expand Up @@ -269,7 +266,9 @@ export function deployProject(localID: string, stream: EventStream) {
stream.register('publish/success', async (msg: EventStreamMessage) => {
if (localID === msg.data.localId) {
unregiserAll();
progress.report({ increment: 100, message: "Deployment was successful" });
progress.report({
message: "Deployment was successful",
});
resolveCB('Success!');

let visitOption = "Visit";
Expand All @@ -286,7 +285,9 @@ export function deployProject(localID: string, stream: EventStream) {
stream.register('publish/failure', (msg: EventStreamMessage) => {
if (localID === msg.data.localId) {
unregiserAll();
progress.report({ increment: 100, message: "Deployment process encountered an error " });
progress.report({
message: "Deployment process encountered an error",
});
rejectCB('Error Encountered!');
}
})
Expand Down

0 comments on commit b4bd589

Please sign in to comment.