Change the API to remove nodejs listeners

This commit is contained in:
Sofiya Tepikin
2022-09-13 19:47:11 +02:00
parent afced905bf
commit 1610c8416a
2 changed files with 8 additions and 6 deletions
+2 -2
View File
@@ -36,9 +36,9 @@ const PasswordPrompt = ({ enableShowApp }) => {
}
useEffect(() => {
nodejs.channel.addListener('check-pw', passHashToDb, this)
const listener = nodejs.channel.addListener('check-pw', passHashToDb, this)
return () => nodejs.channel.remove('check-pw', passHashToDb)
return () => listener.remove()
}, [])
const onDeleteDataConfirmation = async () => {