Skip to content

Commit 9fb6505

Browse files
author
John McCambridge
committed
Add confirmation for closing window
1 parent 4dd74b3 commit 9fb6505

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/ide/src/client.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ export abstract class IdeClient {
3434
this.loadTime = time(2500);
3535

3636
let appWindow: Window | undefined;
37+
38+
window.onbeforeunload = () => {
39+
return "Are you sure you want to navigate away?";
40+
}
41+
3742
window.addEventListener("message", (event) => {
3843
if (event.data === "app") {
3944
appWindow = event.source as Window;

0 commit comments

Comments
 (0)