Skip to content

Commit

Permalink
fix(web): release titleChangeEventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple authored Oct 23, 2024
1 parent 9ddc478 commit 9657627
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/src/components/IFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ export default function IFrame(props: Props): JSX.Element {
return
}

// remove the hashchange event listener to prevent memory leaks
// remove the event listeners to prevent memory leaks
iFrameRef.current.contentWindow?.removeEventListener(
'hashchange',
hashChangeEventListener
)
iFrameRef.current.contentWindow?.removeEventListener(
'titlechange',
titleChangeEventListener
)

const url = iFrameRef.current?.contentDocument?.location.href
if (url == null) {
Expand Down

0 comments on commit 9657627

Please sign in to comment.