π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Ignore button taps
Manav Rathi35c8970d2095
diff --git a/web/apps/photos/src/pages/index.tsx b/web/apps/photos/src/pages/index.tsxindex b532d2262b..48de2c184e 100644--- a/web/apps/photos/src/pages/index.tsx+++ b/web/apps/photos/src/pages/index.tsx@@ -159,20 +159,34 @@ const Container: React.FC<React.PropsWithChildren> = ({ children }) => {const [tapCount, setTapCount] = useState(0);const [showDevSettings, setShowDevSettings] = useState(false);- const handleClick = () => {+ const handleClick: React.MouseEventHandler = (event) => {+ console.log("click", tapCount, event, event.target);++ // Ignore clicks on buttons when counting up towards 7.+ if (event.target instanceof HTMLButtonElement) return;++ // Otherwise increase the tap count,setTapCount(tapCount + 1);+ // And show the dev settings dialog when it reaches 7.if (tapCount + 1 == 7) {setTapCount(0);setShowDevSettings(true);}};+ 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}><><DevSettingsopen={showDevSettings}- onClose={() => setShowDevSettings(false)}+ onClose={handleDevSettingsClose}/>{children}</>