From cb531beaef868dd75aa625e1f881a0304d7355c4 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 25 May 2016 21:30:48 +0200 Subject: don't start transaction if there is no work --- lib/wallet/query.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/wallet') diff --git a/lib/wallet/query.ts b/lib/wallet/query.ts index d5ec1fecc..b4f9c511b 100644 --- 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 = () => { -- cgit v1.2.3