Skip to content

Commit

Permalink
Reverted unintentional code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Jul 15, 2023
1 parent b75d6ac commit 1899292
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/classes/dexie/dexie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ export class Dexie implements IDexie {

this._maxKey = getMaxKey(options.IDBKeyRange as typeof IDBKeyRange);

this._createTransaction = function (
this._createTransaction = (
mode: IDBTransactionMode,
storeNames: string[],
dbschema: DbSchema,
parentTransaction?: Transaction) { return new this.Transaction(mode, storeNames, dbschema, this._options.chromeTransactionDurability, parentTransaction) };
parentTransaction?: Transaction) => new this.Transaction(mode, storeNames, dbschema, this._options.chromeTransactionDurability, parentTransaction);

this._fireOnBlocked = ev => {
this.on("blocked").fire(ev);
Expand Down
9 changes: 4 additions & 5 deletions src/classes/dexie/transaction-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ export function enterTransactionScope(
}, zoneProps);
return (returnValue && typeof returnValue.then === 'function' ?
// Promise returned. User uses promise-style transactions.
Promise.resolve(returnValue).then(x => {
if (trans.active) return x; // Transaction still active. Continue.
throw new exceptions.PrematureCommit(
"Transaction committed too early. See http://bit.ly/2kdckMn");
})
Promise.resolve(returnValue).then(x => trans.active ?
x // Transaction still active. Continue.
: rejection(new exceptions.PrematureCommit(
"Transaction committed too early. See http://bit.ly/2kdckMn")))
// No promise returned. Wait for all outstanding promises before continuing.
: promiseFollowed.then(() => returnValue)
).then(x => {
Expand Down

0 comments on commit 1899292

Please sign in to comment.