From 914b8effae9d80f68dd34db69669cc25ab0f9356 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Sun, 1 Oct 2023 13:59:21 +0100 Subject: [PATCH] fix: do not offer file upload when logged out (#17696) --- frontend/src/lib/components/Support/SupportModal.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/Support/SupportModal.tsx b/frontend/src/lib/components/Support/SupportModal.tsx index 3d663df008d5a..a681dd85925fa 100644 --- a/frontend/src/lib/components/Support/SupportModal.tsx +++ b/frontend/src/lib/components/Support/SupportModal.tsx @@ -12,6 +12,7 @@ import { LemonFileInput } from 'lib/lemon-ui/LemonFileInput/LemonFileInput' import { useRef } from 'react' import { LemonInput, lemonToast } from '@posthog/lemon-ui' import { useUploadFiles } from 'lib/hooks/useUploadFiles' +import { userLogic } from 'scenes/userLogic' const SUPPORT_TICKET_OPTIONS: LemonSelectOptions = [ { @@ -45,6 +46,8 @@ export function SupportModal({ loggedIn = true }: { loggedIn?: boolean }): JSX.E const { sendSupportRequest, isSupportFormOpen, sendSupportLoggedOutRequest } = useValues(supportLogic) const { setSendSupportRequestValue, closeSupportForm } = useActions(supportLogic) const { objectStorageAvailable } = useValues(preflightLogic) + // the support model can be shown when logged out, file upload is not offered to anonymous users + const { user } = useValues(userLogic) if (!preflightLogic.values.preflight?.cloud) { if (isSupportFormOpen) { @@ -124,7 +127,7 @@ export function SupportModal({ loggedIn = true }: { loggedIn?: boolean }): JSX.E data-attr="support-form-content-input" {...props} /> - {objectStorageAvailable && ( + {objectStorageAvailable && !!user && (