Fix effect dependencies (#1019)
* Fix missing effect dependencies * Remove unnecessary effect dependency
This commit is contained in:
parent
32ea514286
commit
6e75b9d274
|
@ -228,7 +228,7 @@ const WalletLoggerProvider = ({ children }) => {
|
||||||
const log = { wallet, level, message, ts: +new Date() }
|
const log = { wallet, level, message, ts: +new Date() }
|
||||||
saveLog(log)
|
saveLog(log)
|
||||||
setLogs((prevLogs) => [...prevLogs, log])
|
setLogs((prevLogs) => [...prevLogs, log])
|
||||||
}, [setLogs, saveLog])
|
}, [saveLog])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WalletLogsContext.Provider value={logs}>
|
<WalletLogsContext.Provider value={logs}>
|
||||||
|
|
|
@ -131,7 +131,7 @@ export function NWCProvider ({ children }) {
|
||||||
} finally {
|
} finally {
|
||||||
setInitialized(true)
|
setInitialized(true)
|
||||||
}
|
}
|
||||||
}, [logger])
|
}, [validateParams, logger])
|
||||||
|
|
||||||
const saveConfig = useCallback(async (config) => {
|
const saveConfig = useCallback(async (config) => {
|
||||||
// immediately store config so it's not lost even if config is invalid
|
// immediately store config so it's not lost even if config is invalid
|
||||||
|
@ -252,7 +252,7 @@ export function NWCProvider ({ children }) {
|
||||||
// relay?.close()
|
// relay?.close()
|
||||||
if (relay) logger.info(`closed connection to ${relayUrl}`)
|
if (relay) logger.info(`closed connection to ${relayUrl}`)
|
||||||
}
|
}
|
||||||
}, [walletPubkey, secret, logger])
|
}, [walletPubkey, relayUrl, secret, logger])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadConfig().catch(err => logger.error(err.message || err.toString?.()))
|
loadConfig().catch(err => logger.error(err.message || err.toString?.()))
|
||||||
|
|
Loading…
Reference in New Issue