From 7f1f1f475015f8a21c4a0b5db93d1dc8a30e7ea2 Mon Sep 17 00:00:00 2001 From: Danil Kovtonyuk Date: Fri, 24 Jun 2022 16:17:17 +1000 Subject: [PATCH] fix: init idb --- plugins/idb.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/idb.js b/plugins/idb.js index 1516961..15a857f 100644 --- a/plugins/idb.js +++ b/plugins/idb.js @@ -222,7 +222,7 @@ class IndexedDB { } } -export default (ctx, inject) => { +export default async (ctx, inject) => { const instances = new Map() const DEPOSIT_INDEXES = [ @@ -246,7 +246,7 @@ export default (ctx, inject) => { } ] - Object.keys(networkConfig).forEach(async (key) => { + for (const key of Object.keys(networkConfig)) { const { tokens, nativeCurrency } = networkConfig[key] const netId = Number(key.replace('netId', '')) @@ -295,10 +295,10 @@ export default (ctx, inject) => { const instance = new IndexedDB(options) - await instance.initDB() - instances.set(options.dbName, instance) - }) + + await instance.initDB() + } const getInstance = (netId) => instances.get(`tornado_cash_${netId}`)