clear lnc state on detach

This commit is contained in:
keyan 2024-04-27 18:30:03 -05:00
parent b9d30b4076
commit da71103e42
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,6 @@ export function LNCProvider ({ children }) {
const saveConfig = useCallback(async config => {
setConfig(config)
console.log(config)
try {
lnc.credentials.pairingPhrase = config.pairingPhrase
lnc.credentials.password = config?.password || XXX_DEFAULT_PASSWORD
@ -117,6 +116,7 @@ export function LNCProvider ({ children }) {
await lnc.credentials.clear(false)
if (lnc.isConnected) lnc.disconnect()
setStatus(undefined)
setConfig({})
logger.info('cleared config')
}, [logger, lnc])