Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
Stop the host on window unload
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokome Bentley committed May 31, 2018
1 parent 5b40595 commit a7683d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ window.addEventListener('load', () => {
}, window.document.body)
})
})

window.addEventListener('beforeunload', () => {
// Stop the host (and any peer hosts that it has spawned)
host.stop()
})

0 comments on commit a7683d7

Please sign in to comment.