aboutsummaryrefslogtreecommitdiff
path: root/extension/lib/wallet/db.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-01-24 02:29:13 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-01-24 02:29:13 +0100
commitb8627813be56e04c18baf38885f3a3dc0fb7496c (patch)
treee2db304d381cc343021a8af8c94b58e3554fbcc5 /extension/lib/wallet/db.ts
parent1a0a302ad9bfd49ff452bf874e04b7623e23cb5f (diff)
Replace handlebars with mithril, hooks for i18n.
The wallet is now a single page application.
Diffstat (limited to 'extension/lib/wallet/db.ts')
-rw-r--r--extension/lib/wallet/db.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/extension/lib/wallet/db.ts b/extension/lib/wallet/db.ts
index a208f0923..8c331ef6f 100644
--- a/extension/lib/wallet/db.ts
+++ b/extension/lib/wallet/db.ts
@@ -33,7 +33,7 @@ const DB_VERSION = 1;
*/
export function openTalerDb(): Promise<IDBDatabase> {
return new Promise((resolve, reject) => {
- let req = indexedDB.open(DB_NAME, DB_VERSION);
+ const req = indexedDB.open(DB_NAME, DB_VERSION);
req.onerror = (e) => {
reject(e);
};
@@ -45,16 +45,17 @@ export function openTalerDb(): Promise<IDBDatabase> {
console.log("DB: upgrade needed: oldVersion = " + e.oldVersion);
switch (e.oldVersion) {
case 0: // DB does not exist yet
- let mints = db.createObjectStore("mints", {keyPath: "baseUrl"});
+ const mints = db.createObjectStore("mints", {keyPath: "baseUrl"});
mints.createIndex("pubKey", "keys.master_public_key");
db.createObjectStore("reserves", {keyPath: "reserve_pub"});
db.createObjectStore("denoms", {keyPath: "denomPub"});
- let coins = db.createObjectStore("coins", {keyPath: "coinPub"});
+ const coins = db.createObjectStore("coins", {keyPath: "coinPub"});
coins.createIndex("mintBaseUrl", "mintBaseUrl");
db.createObjectStore("transactions", {keyPath: "contractHash"});
db.createObjectStore("precoins",
{keyPath: "coinPub", autoIncrement: true});
- db.createObjectStore("history", {keyPath: "id", autoIncrement: true});
+ const history = db.createObjectStore("history", {keyPath: "id", autoIncrement: true});
+ history.createIndex("timestamp", "timestamp");
break;
}
};