Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions packages/code-studio/src/main/AppMainContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,14 @@ export class AppMainContainer extends Component<
AppMainContainerState
> {
static handleWindowBeforeUnload(event: BeforeUnloadEvent): void {
event.preventDefault();
// returnValue is required for beforeReload event prompt
// https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload#example
// eslint-disable-next-line no-param-reassign
event.returnValue = '';
// in development, allow auto-reload
if (import.meta.env.PROD) {
event.preventDefault();
// returnValue is required for beforeReload event prompt
// https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload#example
// eslint-disable-next-line no-param-reassign
event.returnValue = '';
}
}

static hydrateConsole(
Expand Down