@fireproof/core 0.10.1-dev → 0.10.3-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17374,23 +17374,24 @@ You can use close({ resize: true }) to resize header`);
|
|
17374
17374
|
return __async(this, null, function* () {
|
17375
17375
|
if (!this.idb) {
|
17376
17376
|
const dbName = `fp.${FORMAT}.${this.keyId}.${this.name}.valet`;
|
17377
|
-
|
17377
|
+
this.idb = yield openDB(dbName, 1, {
|
17378
17378
|
upgrade(db) {
|
17379
17379
|
db.createObjectStore("cars");
|
17380
17380
|
}
|
17381
|
-
};
|
17382
|
-
this.idb = yield openDB(dbName, 0, options);
|
17381
|
+
});
|
17383
17382
|
}
|
17384
17383
|
return yield dbWorkFun(this.idb);
|
17385
17384
|
});
|
17386
17385
|
}
|
17387
17386
|
load(cid) {
|
17388
17387
|
return __async(this, null, function* () {
|
17388
|
+
console.log("loading", cid.toString());
|
17389
17389
|
return yield this.withDB((db) => __async(this, null, function* () {
|
17390
17390
|
const tx = db.transaction(["cars"], "readonly");
|
17391
17391
|
const bytes = yield tx.objectStore("cars").get(cid.toString());
|
17392
17392
|
if (!bytes)
|
17393
|
-
throw new Error(`missing block ${cid.toString()}`);
|
17393
|
+
throw new Error(`missing idb block ${cid.toString()}`);
|
17394
|
+
console.log("loaded", cid.toString());
|
17394
17395
|
return { cid, bytes };
|
17395
17396
|
}));
|
17396
17397
|
});
|