MCPcopy Create free account
hub / github.com/dailydotdev/apps / closeHandler

Function closeHandler

packages/shared/src/hooks/useExitConfirmation.ts:32–41  ·  view source on GitHub ↗
(e: BeforeUnloadEvent)

Source from the content-addressed store, hash-verified

30 }
31
32 const closeHandler = (e: BeforeUnloadEvent) => {
33 const shouldAskConfirmation = checkShouldAskConfirmation();
34
35 if (shouldAskConfirmation) {
36 return;
37 }
38
39 e.preventDefault();
40 e.returnValue = message;
41 };
42
43 const routeHandler = (url: string, { shallow }: { shallow?: boolean }) => {
44 // Shallow changes on the same page (e.g. ?tab=) leave nothing behind.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected