Merge branch 'chore/nodejs-mobile-new-api' into 'main'
Change the API to remove nodejs listeners See merge request bloodyhealth/drip!524
This commit is contained in:
@@ -36,9 +36,9 @@ const PasswordPrompt = ({ enableShowApp }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
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 () => {
|
const onDeleteDataConfirmation = async () => {
|
||||||
|
|||||||
@@ -24,10 +24,12 @@ const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
nodejs.channel.addListener('password-check', checkPassword, this)
|
const listener = nodejs.channel.addListener(
|
||||||
return () => {
|
'password-check',
|
||||||
nodejs.channel.removeListener('password-check', checkPassword)
|
checkPassword,
|
||||||
}
|
this
|
||||||
|
)
|
||||||
|
return () => listener.remove()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const onIncorrectPassword = () => {
|
const onIncorrectPassword = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user