clear lnc state on detach
This commit is contained in:
parent
b9d30b4076
commit
da71103e42
|
@ -94,7 +94,6 @@ export function LNCProvider ({ children }) {
|
||||||
const saveConfig = useCallback(async config => {
|
const saveConfig = useCallback(async config => {
|
||||||
setConfig(config)
|
setConfig(config)
|
||||||
|
|
||||||
console.log(config)
|
|
||||||
try {
|
try {
|
||||||
lnc.credentials.pairingPhrase = config.pairingPhrase
|
lnc.credentials.pairingPhrase = config.pairingPhrase
|
||||||
lnc.credentials.password = config?.password || XXX_DEFAULT_PASSWORD
|
lnc.credentials.password = config?.password || XXX_DEFAULT_PASSWORD
|
||||||
|
@ -117,6 +116,7 @@ export function LNCProvider ({ children }) {
|
||||||
await lnc.credentials.clear(false)
|
await lnc.credentials.clear(false)
|
||||||
if (lnc.isConnected) lnc.disconnect()
|
if (lnc.isConnected) lnc.disconnect()
|
||||||
setStatus(undefined)
|
setStatus(undefined)
|
||||||
|
setConfig({})
|
||||||
logger.info('cleared config')
|
logger.info('cleared config')
|
||||||
}, [logger, lnc])
|
}, [logger, lnc])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue