Skip to content

Commit

Permalink
Remove both leftover listeners every awaitAsyncResult
Browse files Browse the repository at this point in the history
  • Loading branch information
MarmadileManteater committed Jan 9, 2025
1 parent 6c2f511 commit efa9328
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/renderer/helpers/android.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ export function awaitAsyncResult(id) {
const resolveWrapper = () => {
resolve(android.getSyncMessage(id))
window.removeEventListener(`${id}-resolve`, resolveWrapper)
window.removeEventListener(`${id}-reject`, rejectWrapper)
}
window.addEventListener(`${id}-resolve`, resolveWrapper)
const rejectWrapper = () => {
reject(android.getSyncMessage(id))
window.removeEventListener(`${id}-resolve`, resolveWrapper)
window.removeEventListener(`${id}-reject`, rejectWrapper)
}
window.addEventListener(`${id}-reject`, rejectWrapper)
Expand Down

0 comments on commit efa9328

Please sign in to comment.