Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: monkvision/monkjs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0ff132468ce1d62fb0cb0ef843bca4e12eb9735e
Choose a base ref
..
head repository: monkvision/monkjs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 242780e42a8c43ab24a94992a37ef90155c13707
Choose a head ref
Showing with 13 additions and 13 deletions.
  1. +1 −1 apps/demo-app/src/index.tsx
  2. +12 −12 packages/common-ui-web/src/components/PreventExit/PreventExit.tsx
2 changes: 1 addition & 1 deletion apps/demo-app/src/index.tsx
Original file line number Diff line number Diff line change
@@ -3,12 +3,12 @@ import { MonitoringProvider } from '@monkvision/monitoring';
import { AnalyticsProvider } from '@monkvision/analytics';
import { Auth0Provider } from '@auth0/auth0-react';
import { getEnvOrThrow } from '@monkvision/common';
import { PreventExit } from '@monkvision/common-ui-web';
import { sentryMonitoringAdapter } from './sentry';
import { posthogAnalyticsAdapter } from './posthog';
import { AppRouter } from './components';
import './index.css';
import './i18n';
import { PreventExit } from '@monkvision/common-ui-web';

ReactDOM.render(
<MonitoringProvider adapter={sentryMonitoringAdapter}>
24 changes: 12 additions & 12 deletions packages/common-ui-web/src/components/PreventExit/PreventExit.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useEffect } from "react";
import { useEffect } from 'react';

export function PreventExit(){
useEffect(() => {
window.onbeforeunload = function() {
return "Are you sure you want to leave?";
}
return () => {
window.onbeforeunload = null;
}
}, []);
return null;
}
export function PreventExit() {
useEffect(() => {
window.onbeforeunload = () => {
return 'Are you sure you want to leave?';
};
return () => {
window.onbeforeunload = null;
};
}, []);
return null;
}