[Init] Implement error dialog for failed mod loading (#37)

* [Main] Implement error dialog for failed mod loading

* [Main] Initialize Vendetta from entry.js
This commit is contained in:
Amsyar Rasyiq 2023-03-16 00:36:12 +08:00 committed by GitHub
parent 388b306e88
commit 7dc0b1286a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 25 deletions

View file

@ -7,29 +7,22 @@ import initFixes from "@lib/fixes";
import logger from "@lib/logger";
import windowObject from "@lib/windowObject";
// This logs in the native logging implementation, e.g. logcat
console.log("Hello from Vendetta!");
export default async () => {
// Load everything in parallel
const unloads = await Promise.all([
patchLogHook(),
patchAssets(),
patchCommands(),
initFixes(),
initSettings(),
]);
(async () => {
try {
// Load everything in parallel
const unloads = await Promise.all([
patchLogHook(),
patchAssets(),
patchCommands(),
initFixes(),
initSettings(),
]);
// Assign window object
window.vendetta = await windowObject(unloads);
// Assign window object
window.vendetta = await windowObject(unloads);
// Once done, load plugins
unloads.push(await initPlugins());
// Once done, load plugins
unloads.push(await initPlugins());
// We good :)
logger.log("Vendetta is ready!");
} catch (e: any) {
alert(`Vendetta failed to initialize... ${e.stack || e.toString()}`);
}
})();
// We good :)
logger.log("Vendetta is ready!");
}