Skip to content

Commit

Permalink
📝 Drop useless calls to counter API
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz authored Dec 22, 2024
1 parent b394202 commit 34f8665
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 34f8665

Please sign in to comment.