From 18851c3f87d21395f8cd8e4b3c7ec5dba4326449 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Wed, 8 Apr 2020 12:16:09 +1000 Subject: [PATCH] Move builing paths after storage becomes ready. We do this so it doesn't block any of the other communication apis from being initialized. --- js/background.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/background.js b/js/background.js index e494311ed..6a800039b 100644 --- a/js/background.js +++ b/js/background.js @@ -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);