Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(files): address PR review — fix xlsx type, simplify error helper,…
… tighten iframe sandbox
  • Loading branch information
waleedlatif1 committed Apr 5, 2026
commit 13c491947ea33880294a2a0c46eec1eb382d78a2
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ const ImagePreview = memo(function ImagePreview({ file }: { file: WorkspaceFileR
})

function resolvePreviewError(fetchError: Error | null, renderError: string | null): string | null {
if (fetchError) return fetchError instanceof Error ? fetchError.message : 'Failed to load file'
if (fetchError) return fetchError.message
return renderError
}

Expand Down Expand Up @@ -955,7 +955,7 @@ const DocxPreview = memo(function DocxPreview({
<div className='flex flex-1 overflow-hidden'>
<iframe
srcDoc={buildDocxPreviewHtml(html)}
sandbox='allow-same-origin'
sandbox=''
title={file.name}
className='h-full w-full border-0'
/>
Expand Down Expand Up @@ -1013,7 +1013,7 @@ const XlsxPreview = memo(function XlsxPreview({
try {
setRenderError(null)
const XLSX = await import('xlsx')
const workbook = XLSX.read(data, { type: 'array' })
const workbook = XLSX.read(new Uint8Array(data), { type: 'array' })
if (!cancelled) {
Comment thread
waleedlatif1 marked this conversation as resolved.
workbookRef.current = workbook
setSheetNames(workbook.SheetNames)
Expand Down
Loading