IndexDB fixes
This commit is contained in:
@ -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",
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user