diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-02-18 23:41:29 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-02-18 23:41:29 +0100 |
commit | d8609a70e9d843bbd83d95adc866b331c749651a (patch) | |
tree | 0ac798003300e22e11d35588481240dab6aff571 /extension/lib/wallet/wallet.ts | |
parent | 079e764ae6f827b1fa7c12b26f370199fc5e4d48 (diff) |
notify popup of changes
Diffstat (limited to 'extension/lib/wallet/wallet.ts')
-rw-r--r-- | extension/lib/wallet/wallet.ts | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/extension/lib/wallet/wallet.ts b/extension/lib/wallet/wallet.ts index eca937ff1..2d4a29c8d 100644 --- a/extension/lib/wallet/wallet.ts +++ b/extension/lib/wallet/wallet.ts @@ -22,7 +22,7 @@ */ import * as native from "./emscriptif"; -import {AmountJson, CreateReserveResponse, IMintInfo, Denomination} from "./types"; +import {AmountJson, CreateReserveResponse, IMintInfo, Denomination, Notifier} from "./types"; import {HttpResponse, RequestException} from "./http"; import {Query} from "./query"; import {Checkable} from "./checkable"; @@ -492,12 +492,17 @@ export class Wallet { private db: IDBDatabase; private http: HttpRequestLibrary; private badge: Badge; + private notifier: Notifier; - constructor(db: IDBDatabase, http: HttpRequestLibrary, badge: Badge) { + constructor(db: IDBDatabase, + http: HttpRequestLibrary, + badge: Badge, + notifier: Notifier) { this.db = db; this.http = http; this.badge = badge; + this.notifier = notifier; } @@ -687,7 +692,8 @@ export class Wallet { .put("transactions", t) .put("history", historyEntry) .putAll("coins", payCoinInfo.map((pci) => pci.updatedCoin)) - .finish(); + .finish() + .then(() => { this.notifier.notify(); }); } @@ -896,7 +902,8 @@ export class Wallet { .delete("precoins", coin.coinPub) .add("coins", coin) .add("history", historyEntry) - .finish(); + .finish() + .then(() => { this.notifier.notify(); }); } |