From ef8ae60afd7d005c26b224774f3302fbc5189945 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Sat, 24 May 2025 22:44:05 -0700 Subject: [PATCH] fix(file-upload): fixed file upload for mistral parse --- apps/sim/blocks/blocks/file.ts | 3 +-- apps/sim/blocks/blocks/mistral_parse.ts | 3 +-- apps/sim/lib/uploads/setup.ts | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/sim/blocks/blocks/file.ts b/apps/sim/blocks/blocks/file.ts index 1dfd0630f2..72f903d021 100644 --- a/apps/sim/blocks/blocks/file.ts +++ b/apps/sim/blocks/blocks/file.ts @@ -1,12 +1,11 @@ import { DocumentIcon } from '@/components/icons' -import { isProd } from '@/lib/environment' import { createLogger } from '@/lib/logs/console-logger' import type { FileParserOutput } from '@/tools/file/types' import type { BlockConfig, SubBlockConfig, SubBlockLayout, SubBlockType } from '../types' const logger = createLogger('FileBlock') -const shouldEnableURLInput = isProd +const shouldEnableURLInput = process.env.NODE_ENV === 'production' const inputMethodBlock: SubBlockConfig = { id: 'inputMethod', diff --git a/apps/sim/blocks/blocks/mistral_parse.ts b/apps/sim/blocks/blocks/mistral_parse.ts index dd87c2a604..49adde5f42 100644 --- a/apps/sim/blocks/blocks/mistral_parse.ts +++ b/apps/sim/blocks/blocks/mistral_parse.ts @@ -1,9 +1,8 @@ import { MistralIcon } from '@/components/icons' -import { isProd } from '@/lib/environment' import type { MistralParserOutput } from '@/tools/mistral/types' import type { BlockConfig, SubBlockConfig, SubBlockLayout, SubBlockType } from '../types' -const shouldEnableFileUpload = isProd +const shouldEnableFileUpload = process.env.NODE_ENV === 'production' const inputMethodBlock: SubBlockConfig = { id: 'inputMethod', diff --git a/apps/sim/lib/uploads/setup.ts b/apps/sim/lib/uploads/setup.ts index b113c28205..5b91cd1560 100644 --- a/apps/sim/lib/uploads/setup.ts +++ b/apps/sim/lib/uploads/setup.ts @@ -1,7 +1,6 @@ import { existsSync } from 'fs' import { mkdir } from 'fs/promises' import path, { join } from 'path' -import { isProd } from '@/lib/environment' import { createLogger } from '@/lib/logs/console-logger' import { env } from '../env' @@ -11,7 +10,7 @@ const PROJECT_ROOT = path.resolve(process.cwd()) export const UPLOAD_DIR = join(PROJECT_ROOT, 'uploads') -export const USE_S3_STORAGE = isProd +export const USE_S3_STORAGE = process.env.NODE_ENV === 'production' export const S3_CONFIG = { bucket: env.S3_BUCKET_NAME || '',