mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 18:30:53 +00:00
fix dirent key={index} bug (#6754)
This commit is contained in:
@@ -839,7 +839,7 @@ class DirentGridView extends React.Component {
|
||||
{direntList.map((dirent, index) => {
|
||||
return (
|
||||
<DirentGridItem
|
||||
key={index}
|
||||
key={dirent.name} // dirent.id is not unique, so use dirent.name as key
|
||||
dirent={dirent}
|
||||
repoID={this.props.repoID}
|
||||
path={this.props.path}
|
||||
|
@@ -691,7 +691,7 @@ class DirentListView extends React.Component {
|
||||
return (
|
||||
<DirentListItem
|
||||
ref={this.setDirentItemRef(index)}
|
||||
key={index}
|
||||
key={dirent.name} // dirent.id is not unique, so use dirent.name as key
|
||||
dirent={dirent}
|
||||
path={this.props.path}
|
||||
repoID={this.props.repoID}
|
||||
|
@@ -551,6 +551,10 @@ class LibContentView extends React.Component {
|
||||
};
|
||||
|
||||
loadDirentList = (path) => {
|
||||
this.setState({
|
||||
isDirentListLoading: true,
|
||||
direntList: [],
|
||||
});
|
||||
let repoID = this.props.repoID;
|
||||
seafileAPI.listDir(repoID, path, { 'with_thumbnail': true }).then(res => {
|
||||
let direntList = [];
|
||||
|
Reference in New Issue
Block a user