[Init] Async-ify, for future use

This commit is contained in:
Beef 2022-10-25 23:50:18 +01:00
parent 91be38564d
commit 88e4f357a4

View file

@ -8,9 +8,11 @@ import initSettings from "@ui/settings";
import { patchLogHook } from "@lib/debug"; import { patchLogHook } from "@lib/debug";
console.log("Hello from Vendetta!"); console.log("Hello from Vendetta!");
let erroredOnLoad = false;
try { async function init() {
let erroredOnLoad = false;
try {
initSettings(); initSettings();
patchAssets(); patchAssets();
patchLogHook(); patchLogHook();
@ -29,9 +31,12 @@ try {
}, },
}, },
}; };
} catch (e: Error | any) { } catch (e: Error | any) {
erroredOnLoad = true; erroredOnLoad = true;
alert(`Vendetta failed to initialize...\n${e.stack || e.toString()}`); alert(`Vendetta failed to initialize...\n${e.stack || e.toString()}`);
} }
if (!erroredOnLoad) logger.log("Vendetta is ready!"); if (!erroredOnLoad) logger.log("Vendetta is ready!");
};
init();