From 4fd1e07449c97619dbf1e0e17baa47168644dba9 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 19 Oct 2016 20:16:01 +0200 Subject: fix db issue --- lib/wallet/query.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/wallet/query.ts') diff --git a/lib/wallet/query.ts b/lib/wallet/query.ts index 3571c32c7..c369e4b67 100644 --- a/lib/wallet/query.ts +++ b/lib/wallet/query.ts @@ -51,6 +51,7 @@ export class Index { constructor(s: Store, indexName: string, keyPath: string | string[]) { this.storeName = s.name; this.indexName = indexName; + this.keyPath = keyPath; } } @@ -60,7 +61,7 @@ export class Index { */ export interface QueryStream { indexJoin(index: Index, - keyFn: (obj: T) => I): QueryStream<[T, S]>; + keyFn: (obj: T) => I): QueryStream>; keyJoin(store: Store, keyFn: (obj: T) => I): QueryStream>; filter(f: (T: any) => boolean): QueryStream; @@ -106,7 +107,7 @@ abstract class QueryStreamBase implements QueryStream { } indexJoin(index: Index, - keyFn: (obj: T) => I): QueryStream<[T, S]> { + keyFn: (obj: T) => I): QueryStream> { this.root.addStoreAccess(index.storeName, false); return new QueryStreamIndexJoin(this, index.storeName, index.indexName, keyFn); } @@ -212,7 +213,7 @@ class QueryStreamFlatMap extends QueryStreamBase { } -class QueryStreamIndexJoin extends QueryStreamBase<[T, S]> { +class QueryStreamIndexJoin extends QueryStreamBase> { s: QueryStreamBase; storeName: string; key: any; @@ -239,7 +240,7 @@ class QueryStreamIndexJoin extends QueryStreamBase<[T, S]> { req.onsuccess = () => { let cursor = req.result; if (cursor) { - f(false, [value, cursor.value], tx); + f(false, {left: value, right: cursor.value}, tx); cursor.continue(); } else { f(true, undefined, tx); -- cgit v1.2.3