commit cb531beaef868dd75aa625e1f881a0304d7355c4
parent 34b65e2ef704fdc4b8c1c24ec86303a75f7ca59d
Author: Florian Dold <florian.dold@gmail.com>
Date: Wed, 25 May 2016 21:30:48 +0200
don't start transaction if there is no work
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/wallet/query.ts b/lib/wallet/query.ts
@@ -357,6 +357,10 @@ class QueryRoot {
return this.kickoffPromise;
}
this.kickoffPromise = new Promise((resolve, reject) => {
+ if (this.work.length == 0) {
+ resolve();
+ return;
+ }
const mode = this.hasWrite ? "readwrite" : "readonly";
const tx = this.db.transaction(Array.from(this.stores), mode);
tx.oncomplete = () => {