From d36675ed33057f4c0c61ea9cb7f083b9ae10ee35 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Wed, 27 May 2020 14:42:30 +0300 Subject: [PATCH] minor fixes --- 6-data-storage/03-indexeddb/article.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/6-data-storage/03-indexeddb/article.md b/6-data-storage/03-indexeddb/article.md index c6948c5b..7b93fd12 100644 --- a/6-data-storage/03-indexeddb/article.md +++ b/6-data-storage/03-indexeddb/article.md @@ -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. -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 let openRequest = indexedDB.open("store", 2);