summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-06-10 10:37:49 +0200
committerFlorian Dold <florian@dold.me>2021-06-10 10:37:49 +0200
commit7b7e3b4565169835ad04062d5c76ba655abd770a (patch)
treea6fe6ade0852d85e91410d57f52c18cb6c547197 /packages/taler-wallet-core/src
parent67e5d68b9309c6d35a92bb052879c41854b2ea73 (diff)
downloadwallet-core-7b7e3b4565169835ad04062d5c76ba655abd770a.tar.gz
wallet-core-7b7e3b4565169835ad04062d5c76ba655abd770a.tar.bz2
wallet-core-7b7e3b4565169835ad04062d5c76ba655abd770a.zip
transaction fixes
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r--packages/taler-wallet-core/src/db.ts19
-rw-r--r--packages/taler-wallet-core/src/util/query.ts14
2 files changed, 29 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts
index b6bab02c5..d02ea192f 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -1,3 +1,22 @@
+/*
+ This file is part of GNU Taler
+ (C) 2021 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Imports.
+ */
import {
openDatabase,
describeStore,
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<any> } = {};
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<any> } = {};
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);