Skip to content

Commit

Permalink
Merge pull request #5966 from NomicFoundation/consent-abort
Browse files Browse the repository at this point in the history
fix: propagate abort during telemetry consent enquiry
  • Loading branch information
galargh authored Nov 22, 2024
2 parents 05ae2b3 + 334a6b7 commit fd3b0cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
7 changes: 0 additions & 7 deletions v-next/hardhat/src/internal/cli/prompt/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ export async function confirmationPromptWithTimeout(
}

return result;
} catch (e) {
if (e === "") {
// If the user cancels the prompt, we quit
return undefined;
}

throw e;
} finally {
// We can always clear the timeout, even if not set, this API is safe to
// call with invalid values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,17 @@ async function getTelemetryConsent(telemetryConsentFilePath?: string) {

if (await exists(telemetryConsentFilePath)) {
// Telemetry consent was already provided, hence return the answer
return (await readJsonFile<TelemetryConsent>(telemetryConsentFilePath))
.consent;
const consent = (
await readJsonFile<TelemetryConsent>(telemetryConsentFilePath)
).consent;

log(`Telemetry consent value: ${consent}`);

return consent;
}

log("No telemetry consent file found");

return undefined;
}

Expand Down

0 comments on commit fd3b0cc

Please sign in to comment.