Skip to content

Commit

Permalink
show alert when user leaves
Browse files Browse the repository at this point in the history
  • Loading branch information
iAmAshuSahoo committed Apr 28, 2024
1 parent 6554975 commit 501d334
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/templates/live.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{{page-title "Live"}}

<script>
window.addEventListener('beforeunload', function(event) {
// Cancel the event
event.preventDefault();
// Chrome requires returnValue to be set
event.returnValue = '';
// Display a confirmation dialog
return '';
});
</script>
<div id="live" data-test-live>
{{#if this.liveService.isJoined}}
<LiveHeader
Expand Down

0 comments on commit 501d334

Please sign in to comment.