Skip to content

Commit

Permalink
📝 Drop useless Advent's calls to counter API (#5557)
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz authored Dec 22, 2024
1 parent b394202 commit bf498f4
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ export function buildAdventOfTheDay(options: Options) {
}

function onSubmit(event: React.SyntheticEvent<HTMLFormElement>) {
const hasAlreadyBeenSolved = retrievePastAnswerIfSolved() !== null;
if (!hasAlreadyBeenSolved) {
fetch(`https://api.counterapi.dev/v1/fast-check/AdventOfPBT2024Day${day}Attempt/up`)
.then((response) => response.json())
.catch(() => {});
}
event.preventDefault();
try {
const answer = extractAnswerFromForm(event);
Expand All @@ -100,11 +94,6 @@ export function buildAdventOfTheDay(options: Options) {
}
lastError = null;
localStorage.setItem(storageKey, answer);
if (!hasAlreadyBeenSolved) {
fetch(`https://api.counterapi.dev/v1/fast-check/AdventOfPBT2024Day${day}Success/up`)
.then((response) => response.json())
.catch(() => {});
}
} catch (err) {
lastError = `Malformed inputs provided!\n${(err as Error).message}`;
}
Expand Down

0 comments on commit bf498f4

Please sign in to comment.