Skip to content

Commit ce3d72b

Browse files
committed
fix: linter errors
1 parent 0691304 commit ce3d72b

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

packages/libraries/laboratory/src/lib/operations.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,16 +472,16 @@ export const useOperations = (
472472
}
473473

474474
return null;
475-
} else {
476-
delete response.extensions.response.body;
477-
478-
setStopOperationsFunctions(prev => {
479-
const newStopOperationsFunctions = { ...prev };
480-
delete newStopOperationsFunctions[activeOperation.id];
481-
return newStopOperationsFunctions;
482-
});
483475
}
484476

477+
delete response.extensions.response.body;
478+
479+
setStopOperationsFunctions(prev => {
480+
const newStopOperationsFunctions = { ...prev };
481+
delete newStopOperationsFunctions[activeOperation.id];
482+
return newStopOperationsFunctions;
483+
});
484+
485485
return response;
486486
},
487487
[activeOperation, props.preflightApi, props.envApi, props.pluginsApi, props.settingsApi],

packages/libraries/laboratory/src/lib/request.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,15 @@ export async function fetchWithRetry(
1616
init: RequestInit,
1717
retryCount = 0,
1818
): Promise<Response> {
19-
let attempt = 0;
20-
21-
while (true) {
19+
for (let attempt = 0; attempt <= retryCount; attempt++) {
2220
try {
2321
return await fetch(input, init);
2422
} catch (error) {
2523
if (attempt >= retryCount) {
2624
throw error;
2725
}
28-
29-
attempt++;
3026
}
3127
}
28+
29+
throw new Error('Unreachable');
3230
}

0 commit comments

Comments
 (0)