mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
auto lint fixes
This commit is contained in:
parent
9f85845973
commit
9b6c806c00
5 changed files with 42 additions and 40 deletions
|
|
@ -15,7 +15,7 @@ interface UseRefreshGuardReturn {
|
|||
/**
|
||||
* Hook to guard against accidental page refresh or navigation away from the site.
|
||||
* Shows both browser's native beforeunload dialog and a custom modal for better UX.
|
||||
*
|
||||
*
|
||||
* @param options Configuration for the refresh guard
|
||||
* @returns Modal state controls and current guard message
|
||||
*/
|
||||
|
|
@ -35,7 +35,7 @@ export const useRefreshGuard = ({
|
|||
// Show browser's native dialog first
|
||||
event.preventDefault();
|
||||
event.returnValue = ''; // Required for Chrome
|
||||
|
||||
|
||||
// Schedule custom modal to show after browser dialog is dismissed
|
||||
// This only happens if user chooses "Stay" on the browser dialog
|
||||
setTimeout(() => {
|
||||
|
|
@ -43,7 +43,7 @@ export const useRefreshGuard = ({
|
|||
setShowModal(true);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
|
||||
return ''; // Required for other browsers
|
||||
};
|
||||
|
||||
|
|
@ -78,4 +78,4 @@ export const useRefreshGuard = ({
|
|||
setShowModal,
|
||||
guardMessage: message
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue