From 5ed09841865eb0c309f1501c6de15fc454478db7 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 15 Feb 2022 14:22:09 +0100 Subject: fix loading initial data and verify it in automated tests --- common/indexeddb.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/indexeddb.js b/common/indexeddb.js index cf38d23..1c6244b 100644 --- a/common/indexeddb.js +++ b/common/indexeddb.js @@ -111,7 +111,8 @@ async function perform_upgrade(event) { store = opened_db.createObjectStore(store_name, key_mode); const ctx = make_context(store.transaction, initial_data.file); - await _save_items(initial_data.resource, initial_data.mapping, [], ctx); + await _save_items(initial_data.resource, initial_data.mapping, + initial_data.repo || [], ctx); return opened_db; } @@ -312,8 +313,10 @@ async function _save_items(resources, mappings, repos, context) for (const item of resources.concat(mappings)) await save_item(item, context); - for (const repo_url of repos) + for (const repo_url of repos) { + broadcast.prepare(context.sender, "idb_changes_repo", repo_url); await idb_put(context.transaction, "repo", {url: repo_url}); + } await finalize_transaction(context); } -- cgit v1.2.3