mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-03 15:03:22 +00:00
11 lines
304 B
TypeScript
11 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;
|
||
|
|
}
|