forked from tornadocash/classic-ui
fix: init idb
This commit is contained in:
parent
0b4f3b6258
commit
7f1f1f4750
@ -222,7 +222,7 @@ class IndexedDB {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (ctx, inject) => {
|
export default async (ctx, inject) => {
|
||||||
const instances = new Map()
|
const instances = new Map()
|
||||||
|
|
||||||
const DEPOSIT_INDEXES = [
|
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 { tokens, nativeCurrency } = networkConfig[key]
|
||||||
|
|
||||||
const netId = Number(key.replace('netId', ''))
|
const netId = Number(key.replace('netId', ''))
|
||||||
@ -295,10 +295,10 @@ export default (ctx, inject) => {
|
|||||||
|
|
||||||
const instance = new IndexedDB(options)
|
const instance = new IndexedDB(options)
|
||||||
|
|
||||||
await instance.initDB()
|
|
||||||
|
|
||||||
instances.set(options.dbName, instance)
|
instances.set(options.dbName, instance)
|
||||||
})
|
|
||||||
|
await instance.initDB()
|
||||||
|
}
|
||||||
|
|
||||||
const getInstance = (netId) => instances.get(`tornado_cash_${netId}`)
|
const getInstance = (netId) => instances.get(`tornado_cash_${netId}`)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user