Skip to content

Commit 9af4e65

Browse files
committed
fix(file): zero byte codegen file format
1 parent 9eb55e2 commit 9af4e65

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/pdf-viewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const PdfViewerCore = memo(function PdfViewerCore({ source, filename }: P
7979

8080
const sourceValue = source.kind === 'url' ? source.url : source.buffer
8181
const file = useMemo(
82-
() => (source.kind === 'url' ? source.url : { data: new Uint8Array(source.buffer) }),
82+
() => (source.kind === 'url' ? source.url : { data: new Uint8Array(source.buffer.slice(0)) }),
8383
[sourceValue]
8484
)
8585

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ export const ResourceContent = memo(function ResourceContent({
117117
const rawPreviewText = previewSession?.previewText
118118
const streamingPreviewText =
119119
typeof rawPreviewText === 'string' && rawPreviewText.length > 0 ? rawPreviewText : undefined
120+
const pendingOrStreamingFilePreviewText =
121+
previewSession?.fileId === resource.id && typeof rawPreviewText === 'string'
122+
? rawPreviewText
123+
: undefined
120124

121125
if (previewSession && resource.id === 'streaming-file') {
122126
return (
@@ -152,9 +156,7 @@ export const ResourceContent = memo(function ResourceContent({
152156
workspaceId={workspaceId}
153157
fileId={resource.id}
154158
previewMode={previewMode}
155-
streamingContent={
156-
previewSession?.fileId === resource.id ? streamingPreviewText : undefined
157-
}
159+
streamingContent={pendingOrStreamingFilePreviewText}
158160
streamingMode='replace'
159161
disableStreamingAutoScroll={disableStreamingAutoScroll}
160162
previewContextKey={previewContextKey}

0 commit comments

Comments
 (0)