Don't crash the browser as hard when loading a directory with more than 250 files
This commit is contained in:
parent
5301ab4235
commit
6f65f6a217
|
@ -79,7 +79,21 @@ export default () => {
|
||||||
:
|
:
|
||||||
<CSSTransition classNames={'fade'} timeout={250} appear={true} in={true}>
|
<CSSTransition classNames={'fade'} timeout={250} appear={true} in={true}>
|
||||||
<div>
|
<div>
|
||||||
|
{files.length > 250 ?
|
||||||
|
<React.Fragment>
|
||||||
|
<div className={'rounded bg-yellow-400 mb-px p-3'}>
|
||||||
|
<p className={'text-yellow-900 text-sm text-center'}>
|
||||||
|
This directory is too large to display in the browser, limiting
|
||||||
|
the output to the first 250 files.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
{
|
{
|
||||||
|
files.slice(0, 500).map(file => (
|
||||||
|
<FileObjectRow key={file.uuid} file={file}/>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</React.Fragment>
|
||||||
|
:
|
||||||
files.map(file => (
|
files.map(file => (
|
||||||
<FileObjectRow key={file.uuid} file={file}/>
|
<FileObjectRow key={file.uuid} file={file}/>
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in New Issue