IndexDB fixes
Some checks failed
Build / Build NPM Project (push) Successful in 45s
Build / Publish Documentation (push) Failing after 4s
Build / Tag Version (push) Successful in 8s

This commit is contained in:
2025-07-28 13:09:27 -04:00
parent 4caf0e5048
commit 52f64f9e78
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@ztimson/utils", "name": "@ztimson/utils",
"version": "0.26.21", "version": "0.26.22",
"description": "Utility library", "description": "Utility library",
"author": "Zak Timson", "author": "Zak Timson",
"license": "MIT", "license": "MIT",

View File

@ -100,9 +100,9 @@ export class Database {
if(!this.includes(table.name)) { if(!this.includes(table.name)) {
const newDb = new Database(this.database, [...this.tables, table], (this.version ?? 0) + 1); const newDb = new Database(this.database, [...this.tables, table], (this.version ?? 0) + 1);
conn.close(); conn.close();
await newDb.connection; this.connection = newDb.connection;
Object.assign(this, newDb);
await this.connection; await this.connection;
Object.assign(this, newDb);
} }
return this.table<K, T>(table.name); return this.table<K, T>(table.name);
}); });
@ -115,9 +115,9 @@ export class Database {
const conn = await this.connection; const conn = await this.connection;
const newDb = new Database(this.database, this.tables.filter(t => t.name != (<TableOptions>table).name), (this.version ?? 0) + 1); const newDb = new Database(this.database, this.tables.filter(t => t.name != (<TableOptions>table).name), (this.version ?? 0) + 1);
conn.close(); conn.close();
await newDb.connection; this.connection = newDb.connection;
Object.assign(this, newDb);
await this.connection; await this.connection;
Object.assign(this, newDb);
}); });
} }