Skip to content

Commit

Permalink
Adding close listener to correct object. Fixes jakearchibald#169
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Mar 30, 2020
1 parent a71996b commit afc61a8
Show file tree
Hide file tree
Showing 11 changed files with 243 additions and 270 deletions.
2 changes: 1 addition & 1 deletion build/cjs/entry.d.ts.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/cjs/entry.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions build/cjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ function openDB(name, version, { blocked, upgrade, blocking, terminated } = {})
}
if (blocked)
request.addEventListener('blocked', () => blocked());
if (terminated)
request.addEventListener('close', () => terminated());
if (blocking) {
openPromise
.then(db => db.addEventListener('versionchange', blocking))
.catch(() => { });
}
openPromise
.then(db => {
if (terminated)
db.addEventListener('close', () => terminated());
if (blocking)
db.addEventListener('versionchange', () => blocking());
})
.catch(() => { });
return openPromise;
}
/**
Expand Down
2 changes: 1 addition & 1 deletion build/esm/entry.d.ts.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/esm/entry.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions build/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ function openDB(name, version, { blocked, upgrade, blocking, terminated } = {})
}
if (blocked)
request.addEventListener('blocked', () => blocked());
if (terminated)
request.addEventListener('close', () => terminated());
if (blocking) {
openPromise
.then(db => db.addEventListener('versionchange', blocking))
.catch(() => { });
}
openPromise
.then(db => {
if (terminated)
db.addEventListener('close', () => terminated());
if (blocking)
db.addEventListener('versionchange', () => blocking());
})
.catch(() => { });
return openPromise;
}
/**
Expand Down
2 changes: 1 addition & 1 deletion build/iife/index-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit afc61a8

Please sign in to comment.