@bbn/bbn 1.0.398 → 1.0.400
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.
- package/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/db.js +4 -2
- package/dist/fn/init.js +6 -2
- package/package.json +1 -1
package/dist/db.js
CHANGED
|
@@ -274,6 +274,7 @@ var db = {
|
|
|
274
274
|
_stores: {},
|
|
275
275
|
ok: idb !== undefined,
|
|
276
276
|
updateStructure: function (storeName, structure, req) {
|
|
277
|
+
bbn.fn.log("Updating structure for store:", storeName, structure, req);
|
|
277
278
|
var primary = structure.keys.PRIMARY.columns.length > 1 ? structure.keys.PRIMARY.columns : structure.keys.PRIMARY.columns[0];
|
|
278
279
|
var stores = req.objectStoreNames;
|
|
279
280
|
if (!stores.contains(storeName)) {
|
|
@@ -317,8 +318,9 @@ var db = {
|
|
|
317
318
|
});
|
|
318
319
|
},
|
|
319
320
|
add: function (database, name, structure) {
|
|
320
|
-
var _a;
|
|
321
|
-
|
|
321
|
+
var _a, _b;
|
|
322
|
+
bbn.fn.log("ADDING DB", (_a = structure === null || structure === void 0 ? void 0 : structure.keys) === null || _a === void 0 ? void 0 : _a.PRIMARY, structure === null || structure === void 0 ? void 0 : structure.fields);
|
|
323
|
+
if (((_b = structure === null || structure === void 0 ? void 0 : structure.keys) === null || _b === void 0 ? void 0 : _b.PRIMARY) && (structure === null || structure === void 0 ? void 0 : structure.fields)) {
|
|
322
324
|
if (!db._structures[database]) {
|
|
323
325
|
db._structures[database] = {};
|
|
324
326
|
}
|
package/dist/fn/init.js
CHANGED
|
@@ -178,8 +178,12 @@ export default function init(cfg, force) {
|
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
window.addEventListener('online', function () {
|
|
182
|
-
|
|
181
|
+
window.addEventListener('online', function () {
|
|
182
|
+
bbn.env.online = true;
|
|
183
|
+
});
|
|
184
|
+
window.addEventListener('offline', function () {
|
|
185
|
+
bbn.env.online = false;
|
|
186
|
+
});
|
|
183
187
|
bbn.env.isInit = true;
|
|
184
188
|
document.dispatchEvent(new Event("bbninit"));
|
|
185
189
|
if (bbn.env.logging) {
|