minor fixes
This commit is contained in:
parent
8c5fa3a871
commit
d36675ed33
1 changed files with 3 additions and 1 deletions
|
@ -125,7 +125,9 @@ In order to organize that, the `versionchange` event triggers in such case on th
|
||||||
|
|
||||||
If we don't listen to `versionchange` event and don't close the old connection, then the second, new connection won't be made. The `openRequest` object will emit the `blocked` event instead of `success`. So the second tab won't work.
|
If we don't listen to `versionchange` event and don't close the old connection, then the second, new connection won't be made. The `openRequest` object will emit the `blocked` event instead of `success`. So the second tab won't work.
|
||||||
|
|
||||||
Here's the code to correctly handle the parallel upgrade:
|
Here's the code to correctly handle the parallel upgrade.
|
||||||
|
|
||||||
|
It installs `onversionchange` handler after the database is opened, that closes the old connection:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
let openRequest = indexedDB.open("store", 2);
|
let openRequest = indexedDB.open("store", 2);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue