@@ -7,7 +7,6 @@ import {formatBytes} from "../../../utils/Tools";
77import { performCopyFile , performMoveFile } from "../../../utils/API/API" ;
88import { toast } from "react-toastify" ;
99import * as PropTypes from "prop-types" ;
10- import handleViewport from 'react-in-viewport' ;
1110import MediaWidget , { isMedia } from "../../Base/MediaWidget/MediaWidget" ;
1211import { PROP_ITEM } from "../../../utils/RclonePropTypes" ;
1312import ErrorBoundary from "../../../ErrorHandling/ErrorBoundary" ;
@@ -154,24 +153,17 @@ class FileComponent extends React.Component {
154153 </ div >
155154 )
156155 } else {
157- if ( inViewport ) {
158- element = connectDragSource (
159- < tr className = "pointer-cursor fadeIn" >
160- < td onClick = { ( e ) => clickHandler ( e , item ) } >
161- < FileIcon IsDir = { IsDir } MimeType = { MimeType } /> { " " } { Name }
162- </ td >
163- < td > { Size === - 1 ? "-" : formatBytes ( Size , 2 ) } </ td >
164- < td className = "d-none d-md-table-cell" > { modTime . toLocaleDateString ( ) } </ td >
165- < td > < FileActions downloadHandle = { downloadHandle } linkShareHandle = { linkShareHandle }
166- deleteHandle = { deleteHandle } item = { item } /> </ td >
167- </ tr >
168- )
169- } else {
170- // not in view, render an empty div
171- element = ( < tr className = { "pointer-cursor" } style = { { height : "60px" } } >
172-
173- </ tr > )
174- }
156+ element = connectDragSource (
157+ < tr className = "pointer-cursor fadeIn" >
158+ < td onClick = { ( e ) => clickHandler ( e , item ) } >
159+ < FileIcon IsDir = { IsDir } MimeType = { MimeType } /> { " " } { Name }
160+ </ td >
161+ < td > { Size === - 1 ? "-" : formatBytes ( Size , 2 ) } </ td >
162+ < td className = "d-none d-md-table-cell" > { modTime . toLocaleDateString ( ) } </ td >
163+ < td > < FileActions downloadHandle = { downloadHandle } linkShareHandle = { linkShareHandle }
164+ deleteHandle = { deleteHandle } item = { item } /> </ td >
165+ </ tr >
166+ )
175167 }
176168 return < ErrorBoundary >
177169 { element }
@@ -237,9 +229,4 @@ FileComponent.propTypes = {
237229
238230} ;
239231
240- /**
241- * Handles view port to check if the current item is visible on the screen.
242- */
243- const MyViewPort = handleViewport ( FileComponent , { rootMargin : '-1.0px' } ) ;
244-
245- export default DragSource ( ItemTypes . FILECOMPONENT , fileComponentSource , collect ) ( MyViewPort ) ;
232+ export default DragSource ( ItemTypes . FILECOMPONENT , fileComponentSource , collect ) ( FileComponent ) ;
0 commit comments