File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -922,14 +922,15 @@ const DocxPreview = memo(function DocxPreview({
922922
923923 useEffect ( ( ) => {
924924 if ( ! fileData ) return
925+ const data = fileData
925926
926927 let cancelled = false
927928
928929 async function convert ( ) {
929930 try {
930931 setRenderError ( null )
931932 const mammoth = await import ( 'mammoth' )
932- const result = await mammoth . convertToHtml ( { arrayBuffer : fileData } )
933+ const result = await mammoth . convertToHtml ( { arrayBuffer : data } )
933934 if ( ! cancelled ) setHtml ( result . value )
934935 } catch ( err ) {
935936 if ( ! cancelled ) {
@@ -1004,14 +1005,15 @@ const XlsxPreview = memo(function XlsxPreview({
10041005
10051006 useEffect ( ( ) => {
10061007 if ( ! fileData ) return
1008+ const data = fileData
10071009
10081010 let cancelled = false
10091011
10101012 async function parse ( ) {
10111013 try {
10121014 setRenderError ( null )
10131015 const XLSX = await import ( 'xlsx' )
1014- const workbook = XLSX . read ( fileData , { type : 'array' } )
1016+ const workbook = XLSX . read ( data , { type : 'array' } )
10151017 if ( ! cancelled ) {
10161018 workbookRef . current = workbook
10171019 setSheetNames ( workbook . SheetNames )
You can’t perform that action at this time.
0 commit comments