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