Add a user-facing error when the Database is misconfigured.
This commit is contained in:
parent
142586536a
commit
b717b0060b
2 changed files with 9 additions and 1 deletions
|
|
@ -43,7 +43,7 @@ Hooks.on(`init`, () => {
|
||||||
|
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
CONFIG.stats.db = MemoryDatabase;
|
CONFIG.stats.db = MemoryDatabase;
|
||||||
}
|
};
|
||||||
|
|
||||||
Handlebars.registerHelper(helpers);
|
Handlebars.registerHelper(helpers);
|
||||||
registerCustomComponents();
|
registerCustomComponents();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,13 @@
|
||||||
|
import { Database } from "../utils/databases/Database.mjs";
|
||||||
import { Logger } from "../utils/Logger.mjs";
|
import { Logger } from "../utils/Logger.mjs";
|
||||||
|
|
||||||
Hooks.on(`ready`, () => {
|
Hooks.on(`ready`, () => {
|
||||||
Logger.log(`Version: ${__VERSION__}`);
|
Logger.log(`Version: ${__VERSION__}`);
|
||||||
|
|
||||||
|
// Alert GMs when the configured DB is invalid
|
||||||
|
if (!(CONFIG.stats.db.prototype instanceof Database) && game.user.isGM) {
|
||||||
|
ui.notifications.error(`The database handler does not conform to the required heirarchy, the stats tracker module will almost certainly not work correctly.`, { permanent: true });
|
||||||
|
} else {
|
||||||
|
CONFIG.stats.db.registerListeners();
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue