From aa3471efe1629f36adeff8774dfdc379d4652e26 Mon Sep 17 00:00:00 2001 From: Luca <102960244+Luca-Timo@users.noreply.github.com> Date: Fri, 26 Jun 2026 15:28:58 +0200 Subject: [PATCH] fix(gallery): publish dialog stuck for password-protected galleries with no inline email handleSubmit required a password whenever requirePassword was true, but the password field only renders on the inline-email path (requirePassword && customerEmail). For a password-protected gallery with no inline email the field was hidden, so submit blocked on the missing password and the dialog never closed. Gate password collection + validation on a single `needsPassword` (requirePassword && customerEmail); the no-inline-email path publishes without re-entering the password (existing hash kept, customer reaches it via portal). --- .../src/components/admin/PublishGalleryDialog.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/admin/PublishGalleryDialog.tsx b/frontend/src/components/admin/PublishGalleryDialog.tsx index 5aa09c29..55bdcdcb 100644 --- a/frontend/src/components/admin/PublishGalleryDialog.tsx +++ b/frontend/src/components/admin/PublishGalleryDialog.tsx @@ -39,19 +39,24 @@ export const PublishGalleryDialog: React.FC = ({ // Someone gets notified if there's an inline email OR an assigned account // (the latter via the account "your galleries" email). const willNotify = !!customerEmail || assignedCustomerCount > 0; + // The password is only collected (and required) on the inline-email path, + // because the gallery_created email carries it. With no inline email the field + // is hidden and the existing hash is kept — so don't gate submit on it, or a + // password-protected gallery without an email could never be published. + const needsPassword = requirePassword && !!customerEmail; const [password, setPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); const [error, setError] = useState(undefined); const handleSubmit = () => { - if (requirePassword) { + if (needsPassword) { if (!password || password.trim().length < 6) { setError(t('events.publishDialog.errorMinLength', 'Password must be at least 6 characters long.')); return; } } setError(undefined); - onConfirm(requirePassword ? password : undefined); + onConfirm(needsPassword ? password : undefined); }; return ( @@ -92,7 +97,7 @@ export const PublishGalleryDialog: React.FC = ({ })}

- {requirePassword && customerEmail && ( + {needsPassword && (