From 7b7e3b4565169835ad04062d5c76ba655abd770a Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 10 Jun 2021 10:37:49 +0200 Subject: transaction fixes --- packages/taler-wallet-core/src/util/query.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'packages/taler-wallet-core/src/util') diff --git a/packages/taler-wallet-core/src/util/query.ts b/packages/taler-wallet-core/src/util/query.ts index ab5a1fc7a..cf3f791d5 100644 --- a/packages/taler-wallet-core/src/util/query.ts +++ b/packages/taler-wallet-core/src/util/query.ts @@ -454,8 +454,11 @@ function makeReadContext( const indexes: { [s: string]: IndexReadOnlyAccessor } = {}; const swi = storePick[storeAlias]; const storeName = swi.store.name; - for (const indexName in storePick[storeAlias].indexMap) { - indexes[indexName] = { + for (const indexAlias in storePick[storeAlias].indexMap) { + const indexDescriptor: IndexDescriptor = + storePick[storeAlias].indexMap[indexAlias]; + const indexName = indexDescriptor.name; + indexes[indexAlias] = { get(key) { const req = tx.objectStore(storeName).index(indexName).get(key); return requestToPromise(req); @@ -493,8 +496,11 @@ function makeWriteContext( const indexes: { [s: string]: IndexReadWriteAccessor } = {}; const swi = storePick[storeAlias]; const storeName = swi.store.name; - for (const indexName in storePick[storeAlias].indexMap) { - indexes[indexName] = { + for (const indexAlias in storePick[storeAlias].indexMap) { + const indexDescriptor: IndexDescriptor = + storePick[storeAlias].indexMap[indexAlias]; + const indexName = indexDescriptor.name; + indexes[indexAlias] = { get(key) { const req = tx.objectStore(storeName).index(indexName).get(key); return requestToPromise(req); -- cgit v1.2.3