From 9fc07b592be2dcd38ba2fb727503a1f2f4dcea5c Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 16 May 2024 20:02:28 +0530 Subject: [PATCH] [desktop] Prevent accidental dismissal of auto update dialog --- web/apps/photos/src/utils/ui/index.tsx | 1 + web/packages/shared/components/DialogBox/types.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/web/apps/photos/src/utils/ui/index.tsx b/web/apps/photos/src/utils/ui/index.tsx index 562a753fd9..8ac5f94bfe 100644 --- a/web/apps/photos/src/utils/ui/index.tsx +++ b/web/apps/photos/src/utils/ui/index.tsx @@ -68,6 +68,7 @@ export const getUpdateReadyToInstallMessage = ({ variant: "secondary", action: () => ensureElectron().updateOnNextRestart(version), }, + staticBackdrop: true, }); export const getUpdateAvailableForDownloadMessage = ({ diff --git a/web/packages/shared/components/DialogBox/types.ts b/web/packages/shared/components/DialogBox/types.ts index 6d076fd5ab..08b52fe4c3 100644 --- a/web/packages/shared/components/DialogBox/types.ts +++ b/web/packages/shared/components/DialogBox/types.ts @@ -3,6 +3,10 @@ import { ButtonProps } from "@mui/material"; export interface DialogBoxAttributes { icon?: React.ReactNode; title?: string; + /** + * Set this to `true` to prevent the dialog from being closed when the user + * clicks the backdrop outside the dialog. + */ staticBackdrop?: boolean; nonClosable?: boolean; content?: any;