Skip to content

Commit 7365b0f

Browse files
committed
fix
1 parent 470e904 commit 7365b0f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/file-selector/components

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/file-selector/components/google-drive-picker.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,13 @@ export function GoogleDrivePicker({
414414
return <FileIcon className={`${iconSize} text-muted-foreground`} />
415415
}
416416

417+
const canShowPreview = !!(
418+
showPreview &&
419+
selectedFile &&
420+
selectedFileId &&
421+
selectedFile.id === selectedFileId
422+
)
423+
417424
return (
418425
<>
419426
<div className='space-y-2'>
@@ -440,7 +447,7 @@ export function GoogleDrivePicker({
440447
}}
441448
>
442449
<div className='flex min-w-0 items-center gap-2 overflow-hidden'>
443-
{selectedFile ? (
450+
{canShowPreview ? (
444451
<>
445452
{getFileIcon(selectedFile, 'sm')}
446453
<span className='truncate font-normal'>{selectedFile.name}</span>
@@ -460,7 +467,7 @@ export function GoogleDrivePicker({
460467
</Button>
461468

462469
{/* File preview */}
463-
{showPreview && selectedFile && (
470+
{canShowPreview && (
464471
<div className='relative mt-2 rounded-md border border-muted bg-muted/10 p-2'>
465472
<div className='absolute top-2 right-2'>
466473
<Button

0 commit comments

Comments
 (0)