From 83ff98cd3a0fe6768be8075777e40a447d772e3f Mon Sep 17 00:00:00 2001 From: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:19:16 +0530 Subject: [PATCH] fix: Ability to increase file size limit (#2734) Co-authored-by: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> --- .../edit/components/FileUploadQuestionForm.tsx | 14 +++++++++----- packages/lib/storage/service.ts | 18 +++++++++++++++--- packages/lib/utils/promises.ts | 8 ++++++++ .../src/components/general/FileInput.tsx | 18 +++++++++++++++--- 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx index 619ccfaeff..82be6dc8d5 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx @@ -115,6 +115,12 @@ export const FileUploadQuestionForm = ({ return 10; }, [billingInfo, billingInfoError, billingInfoLoading]); + const handleMaxSizeInMBToggle = (checked: boolean) => { + const defaultMaxSizeInMB = isFormbricksCloud ? maxSizeInMBLimit : 1024; + + updateQuestion(questionIdx, { maxSizeInMB: checked ? defaultMaxSizeInMB : undefined }); + }; + return (