mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
tell TS we're certain to have a txn
This commit is contained in:
parent
3d66d71c97
commit
995ed23b3e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user