Skip to content

Commit b50d1b3

Browse files
committed
Specify readonly as the default indexeddb transaction mode
While the mode parameter is optional, the wrapper method will pass `undefined` into the native method if it is not passed into the wrapper. IE11 interprets this as a mode instead of ignoring it and throws an InvalidAccessError. Specifying `readonly` as the default (which is the default if the parameter is omitted) prevents IE11 from crashing during initialization.
1 parent d756f4e commit b50d1b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/util/src/indexeddb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class DBWrapper {
4242
}
4343
transaction(
4444
storeNames: string[] | string,
45-
mode?: IDBTransactionMode
45+
mode: IDBTransactionMode = 'readonly'
4646
): TransactionWrapper {
4747
return new TransactionWrapper(
4848
this._db.transaction.call(this._db, storeNames, mode)

0 commit comments

Comments
 (0)