Skip to content

Commit caf1f6b

Browse files
authored
Update embed.js
1 parent 482de36 commit caf1f6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

embed.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
document.addEventListener("DOMContentLoaded", async () => {
1+
(async () => {
22
const { api: apiUrl, target: targetSelector } = document.currentScript.dataset;
33

44
const target = document.querySelector(targetSelector);
@@ -40,7 +40,7 @@ document.addEventListener("DOMContentLoaded", async () => {
4040
target.innerHTML = "<p style='color:red; text-align: center; font-family: sans-serif;'>Error loading games. Please try again later.</p>";
4141
console.error("Error loading games:", err);
4242
}
43-
});
43+
})();
4444

4545
window.openGame = (apiUrl, alt) => {
4646
const modal = document.getElementById("gameModal");

0 commit comments

Comments
 (0)