summaryrefslogtreecommitdiff
path: root/resources/js/main.js
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-08-26 23:20:37 +0200
committerDaniel Weipert <code@drogueronin.de>2023-08-26 23:20:37 +0200
commitb025d1655483aa13a29ab5594255460b48143a5a (patch)
tree1421476a3d0e7938dc1a86f56be800917caa07e1 /resources/js/main.js
parent36a5d5862c3744f899fe6a5712f81171af144795 (diff)
error handling
Diffstat (limited to 'resources/js/main.js')
-rw-r--r--resources/js/main.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/resources/js/main.js b/resources/js/main.js
index ff570ad..f472a14 100644
--- a/resources/js/main.js
+++ b/resources/js/main.js
@@ -1,4 +1,4 @@
-UI.createEventListener(async function () {
+UI.wrapCallback(async function () {
await initializeDB();
// Load existing state
@@ -19,7 +19,7 @@ UI.createEventListener(async function () {
);
const monsterSelection = UI.openStarterMonsterSelection(possibleStarterMonsters);
- monsterSelection.addEventListener('starter:monster:selected', UI.createEventListener(async (event) => {
+ monsterSelection.addEventListener('starter:monster:selected', UI.wrapCallback(async (event) => {
if (!confirm(`Select ${event.detail.monster.name}?`)) {
return;
}