mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-01 12:03:11 +00:00
10 lines
304 B
TypeScript
10 lines
304 B
TypeScript
/**
|
|
* Returns `undefined` as the dialog close handler while a mutation is pending,
|
|
* preventing backdrop click / ESC from dismissing the dialog.
|
|
*/
|
|
export function guardDialogClose(
|
|
isPending: boolean,
|
|
onClose: () => void,
|
|
): (() => void) | undefined {
|
|
return isPending ? undefined : onClose;
|
|
}
|