From b025d1655483aa13a29ab5594255460b48143a5a Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sat, 26 Aug 2023 23:20:37 +0200 Subject: error handling --- resources/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'resources/js/main.js') 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; } -- cgit v1.2.3