Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Simplify

Manav Rathic2d2612f33e0
diff --git a/web/apps/photos/src/pages/index.tsx b/web/apps/photos/src/pages/index.tsx
index 48de2c184e..2e4c07e577 100644
--- a/web/apps/photos/src/pages/index.tsx
+++ b/web/apps/photos/src/pages/index.tsx
@@ -165,6 +165,9 @@ const Container: React.FC<React.PropsWithChildren> = ({ children }) => {
// Ignore clicks on buttons when counting up towards 7.
if (event.target instanceof HTMLButtonElement) return;
+ // Ignore clicks when the dialog is already open.
+ if (showDevSettings) return;
+
// Otherwise increase the tap count,
setTapCount(tapCount + 1);
// And show the dev settings dialog when it reaches 7.
@@ -174,19 +177,12 @@ const Container: React.FC<React.PropsWithChildren> = ({ children }) => {
}
};
- const handleDevSettingsClose = () => {
- // Reset the count again to ignore any taps when we were open.
- setTapCount(0);
- // Hide the dialog.
- setShowDevSettings(false);
- };
-
return (
<Container_ onClick={handleClick}>
<>
<DevSettings
open={showDevSettings}
- onClose={handleDevSettingsClose}
+ onClose={() => setShowDevSettings(false)}
/>
{children}
</>
diff --git a/web/packages/new/photos/components/DevSettings.tsx b/web/packages/new/photos/components/DevSettings.tsx
index 0c9399a64b..370135b72a 100644
--- a/web/packages/new/photos/components/DevSettings.tsx
+++ b/web/packages/new/photos/components/DevSettings.tsx
@@ -27,10 +27,7 @@ interface DevSettingsProps {
export const DevSettings: React.FC<DevSettingsProps> = ({ open, onClose }) => {
const fullScreen = useMediaQuery("(max-width: 428px)");
- const handleDialogClose: ModalProps["onClose"] = (
- event: Event,
- reason: string,
- ) => {
+ const handleDialogClose: ModalProps["onClose"] = (_, reason: string) => {
// Don't close on backdrop clicks.
if (reason != "backdropClick") onClose();
};