Skip to content

Commit

Permalink
Remove unnecessary async keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiehumphries committed Dec 10, 2024
1 parent 63fe8cc commit 5b6f67a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ function chooseRandom(array) {
return array[Math.floor(Math.random() * array.length)];
}

async function tryUseBookmarkUrl(url) {
function tryUseBookmarkUrl(url) {
try {
const userId = new URL(url).searchParams.get("id");
if (!userId) {
Expand All @@ -839,7 +839,7 @@ async function tryUseBookmarkUrl(url) {
}

async function initialize() {
if (await tryUseBookmarkUrl(location.href)) {
if (tryUseBookmarkUrl(location.href)) {
return;
}

Expand All @@ -863,9 +863,9 @@ async function initialize() {
bookmarkUrlElement.innerText = url;
});

useBookmarkUrlButton.addEventListener("click", async () => {
useBookmarkUrlButton.addEventListener("click", () => {
const url = prompt("Paste your bookmark URL here. The page will reload.");
const success = await tryUseBookmarkUrl(url);
const success = tryUseBookmarkUrl(url);
if (!success) {
alert("Invalid bookmark URL.");
}
Expand All @@ -877,7 +877,7 @@ async function initialize() {
alert("Your bookmark URL has been copied to the clipboard.");
});

clearBookmarkUrlButton.addEventListener("click", async () => {
clearBookmarkUrlButton.addEventListener("click", () => {
const confirmed = confirm(
"Your bookmark URL will be cleared from this browser. Click OK to confirm.",
);
Expand Down

0 comments on commit 5b6f67a

Please sign in to comment.