Fix undefined reference error when updating a table (closes #27)

This commit is contained in:
Oliver-Akins 2025-05-31 15:33:40 -06:00
parent d11262ad01
commit 60b01c55e1

View file

@ -131,8 +131,8 @@ export class Database {
return false; return false;
}; };
const table = this.getTable(tableID); const table = await this.getTable(tableID);
if (!tables[tableID]) { if (!table) {
ui.notifications.error(`Cannot update table that doesn't exist`); ui.notifications.error(`Cannot update table that doesn't exist`);
return false; return false;
}; };
@ -144,7 +144,7 @@ export class Database {
const diff = diffObject( const diff = diffObject(
table, table,
expandObject(changes), expandObject(changes),
{ inner: true, deletionKeys: true }, { deletionKeys: true },
); );
if (Object.keys(diff).length === 0) { return false }; if (Object.keys(diff).length === 0) { return false };