prevent lnc-web's wasm loading side effects from breaking everything
This commit is contained in:
parent
0312012089
commit
e0f91ace41
|
@ -1,6 +1,5 @@
|
||||||
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react'
|
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react'
|
||||||
import { useWalletLogger } from '../logger'
|
import { useWalletLogger } from '../logger'
|
||||||
import LNC from '@lightninglabs/lnc-web'
|
|
||||||
import { Status, migrateLocalStorage } from '.'
|
import { Status, migrateLocalStorage } from '.'
|
||||||
import { bolt11Tags } from '@/lib/bolt11'
|
import { bolt11Tags } from '@/lib/bolt11'
|
||||||
import useModal from '../modal'
|
import useModal from '../modal'
|
||||||
|
@ -16,6 +15,7 @@ const mutex = new Mutex()
|
||||||
|
|
||||||
async function getLNC ({ me }) {
|
async function getLNC ({ me }) {
|
||||||
if (window.lnc) return window.lnc
|
if (window.lnc) return window.lnc
|
||||||
|
const { default: LNC } = await import('@lightninglabs/lnc-web')
|
||||||
// backwards compatibility: migrate to new storage key
|
// backwards compatibility: migrate to new storage key
|
||||||
if (me) migrateLocalStorage('lnc-web:default', `lnc-web:stacker:${me.id}`)
|
if (me) migrateLocalStorage('lnc-web:default', `lnc-web:stacker:${me.id}`)
|
||||||
window.lnc = new LNC({ namespace: me?.id ? `stacker:${me.id}` : undefined })
|
window.lnc = new LNC({ namespace: me?.id ? `stacker:${me.id}` : undefined })
|
||||||
|
|
Loading…
Reference in New Issue