Move builing paths after storage becomes ready.

We do this so it doesn't block any of the other communication apis from being initialized.
pull/1065/head
Mikunj 5 years ago
parent a5961ded1e
commit 18851c3f87

@ -289,6 +289,11 @@
// Update zoom
window.updateZoomFactor();
if (window.lokiFeatureFlags.useOnionRequests) {
// Initialize paths for onion requests
window.lokiSnodeAPI.buildNewOnionPaths();
}
const currentPoWDifficulty = storage.get('PoWDifficulty', null);
if (!currentPoWDifficulty) {
storage.put('PoWDifficulty', window.getDefaultPoWDifficulty());
@ -1422,9 +1427,6 @@
async function connect(firstRun) {
window.log.info('connect');
// Initialize paths for onion requests
await window.lokiSnodeAPI.buildNewOnionPaths();
// Bootstrap our online/offline detection, only the first time we connect
if (connectCount === 0 && navigator.onLine) {
window.addEventListener('offline', onOffline);

Loading…
Cancel
Save