tell TS we're certain to have a txn
This commit is contained in:
parent
3d66d71c97
commit
995ed23b3e
1 changed files with 1 additions and 1 deletions
|
@ -74,7 +74,7 @@ export function openDatabase(name: string, createObjectStore: CreateObjectStore,
|
|||
req.onupgradeneeded = async (ev : IDBVersionChangeEvent) => {
|
||||
const req = ev.target as IDBRequest<IDBDatabase>;
|
||||
const db = req.result;
|
||||
const txn = req.transaction;
|
||||
const txn = req.transaction!;
|
||||
const oldVersion = ev.oldVersion;
|
||||
try {
|
||||
await createObjectStore(db, txn, oldVersion, version);
|
||||
|
|
Reference in a new issue