core-3nweb-client-lib 0.42.11 → 0.42.13
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/build/core/index.js
CHANGED
|
@@ -66,13 +66,7 @@ class Core {
|
|
|
66
66
|
this.idManager = idManager;
|
|
67
67
|
return this.idManager.getId();
|
|
68
68
|
});
|
|
69
|
-
const coreAppsInit = coreInit.then(
|
|
70
|
-
// XXX This should be removed, at some point, as there will be no more
|
|
71
|
-
// users with very old data folders.
|
|
72
|
-
await this.performDataMigrationsAtInit();
|
|
73
|
-
await this.initCoreApps(emitBootEvent);
|
|
74
|
-
this.isInitialized = true;
|
|
75
|
-
});
|
|
69
|
+
const coreAppsInit = coreInit.then(() => this.initCoreApps(emitBootEvent));
|
|
76
70
|
return { coreInit, coreAppsInit, capsForStartup };
|
|
77
71
|
}
|
|
78
72
|
;
|
|
@@ -81,9 +75,11 @@ class Core {
|
|
|
81
75
|
const { watchBoot, emitBootEvent } = makeForBootEvents();
|
|
82
76
|
const keyOpened = await this.initForExistingUserWithCache(userId, async () => storageKey, midDone, emitBootEvent);
|
|
83
77
|
if (keyOpened) {
|
|
84
|
-
const coreInit = midPromise
|
|
78
|
+
const coreInit = midPromise
|
|
79
|
+
.then(idManager => {
|
|
85
80
|
this.idManager = idManager;
|
|
86
|
-
})
|
|
81
|
+
})
|
|
82
|
+
.then(() => this.initCoreApps(emitBootEvent));
|
|
87
83
|
return { coreInit, watchBoot };
|
|
88
84
|
}
|
|
89
85
|
}
|
|
@@ -317,6 +313,9 @@ class Core {
|
|
|
317
313
|
}
|
|
318
314
|
async initCoreApps(emitBootEvent) {
|
|
319
315
|
var _a;
|
|
316
|
+
// XXX This should be removed, at some point, as there will be no more
|
|
317
|
+
// users with very old data folders.
|
|
318
|
+
await this.performDataMigrationsAtInit();
|
|
320
319
|
try {
|
|
321
320
|
const address = this.idManager.getId();
|
|
322
321
|
const getSigner = this.idManager.getSigner;
|
|
@@ -336,6 +335,7 @@ class Core {
|
|
|
336
335
|
throw (0, error_1.errWithCause)(err, 'Failed to initialize core apps');
|
|
337
336
|
}
|
|
338
337
|
emitBootEvent(true);
|
|
338
|
+
this.isInitialized = true;
|
|
339
339
|
}
|
|
340
340
|
getStorages() {
|
|
341
341
|
return this.storages.wrap();
|
|
@@ -279,7 +279,6 @@ class Storages {
|
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
async getRootKey(user, pass, progressCB, cryptor) {
|
|
282
|
-
var _a;
|
|
283
282
|
const storeKeyProgressCB = (0, sign_in_1.makeKeyGenProgressCB)(0, 99, progressCB);
|
|
284
283
|
const storageDir = this.storageDirForUser(user);
|
|
285
284
|
const params = await readRootKeyDerivParamsFromCache(storageDir);
|
|
@@ -287,7 +286,8 @@ class Storages {
|
|
|
287
286
|
return;
|
|
288
287
|
}
|
|
289
288
|
const key = await (0, key_derivation_1.deriveStorageSKey)(cryptor, pass, params, storeKeyProgressCB);
|
|
290
|
-
|
|
289
|
+
const indicatorStore = await StorageAndFS.existing(await storage_2.LocalStorage.makeAndStart((0, path_1.join)(storageDir, LOCAL_STORAGE_DIR), this.storageGetterForLocalStorage, this.cryptor, async () => { }), key);
|
|
290
|
+
return (indicatorStore ? key : undefined);
|
|
291
291
|
}
|
|
292
292
|
async startInitFromCache(user, keyGen, makeNet, resolver, logError) {
|
|
293
293
|
const storageDir = this.storageDirForUser(user);
|