diff --git a/web/packages/base/components/MiniDialog.tsx b/web/packages/base/components/MiniDialog.tsx index a946bc3eeb..0744077582 100644 --- a/web/packages/base/components/MiniDialog.tsx +++ b/web/packages/base/components/MiniDialog.tsx @@ -4,7 +4,6 @@ /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton"; import { LoadingButton } from "@/base/components/mui/LoadingButton"; -import { dialogCloseHandler } from "@ente/shared/components/DialogBox/TitleWithCloseButton"; import type { ButtonProps } from "@mui/material"; import { Box, @@ -122,11 +121,10 @@ export const AttributedMiniDialog: React.FC< return <>; } - const handleClose = dialogCloseHandler({ - staticBackdrop: attributes.staticBackdrop, - nonClosable: attributes.nonClosable, - onClose: onClose, - }); + const handleClose = () => { + if (attributes.nonClosable) return; + onClose(); + }; const { PaperProps, ...rest } = props; @@ -171,49 +169,38 @@ export const AttributedMiniDialog: React.FC< )} {children} - {(attributes.proceed || attributes.close) && ( - - {attributes.proceed && ( - { - await attributes.proceed?.action( - setLoading, - ); - - onClose(); - }} - > - {attributes.proceed.text} - - )} - {attributes.close && ( - { - attributes.close?.action && - attributes.close?.action(); - onClose(); - }} - > - {attributes.close?.text ?? t("ok")} - - )} - - )} + + {attributes.continue && ( + { + await attributes.continue?.action?.(setLoading); + onClose(); + }} + > + {attributes.continue?.text ?? t("ok")} + + )} + {attributes.cancel && ( + + {attributes.cancel ?? t("cancel")} + + )} + );