Skip to content

Commit f8104f0

Browse files
fix: enhance progress reporting in waitUntilComplete method
1 parent a03bdac commit f8104f0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/tools/accessiblity-utils/scanner.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,20 @@ export class AccessibilityScanner {
7171
context: any,
7272
): Promise<string> {
7373
return new Promise((resolve, reject) => {
74+
let timepercent = 0;
75+
let dotCount = 1;
7476
const interval = setInterval(async () => {
7577
try {
7678
const statusResp = await this.pollStatus(scanId, scanRunId);
7779
const status = statusResp.data!.status;
78-
const progress = status === "completed" ? 100 : 0;
80+
timepercent += 1.67;
81+
const progress = status === "completed" ? 100 : timepercent;
82+
const dots = ".".repeat(dotCount);
83+
dotCount = (dotCount % 4) + 1;
7984
const message =
8085
status === "completed" || status === "failed"
81-
? `Scan completed with status : ${status}`
82-
: `Scan in progress ...`;
86+
? `Scan completed with status: ${status}`
87+
: `Scan in progress${dots}`;
8388
await context.sendNotification({
8489
method: "notifications/progress",
8590
params: {

0 commit comments

Comments
 (0)